Quoting a line or two from a movie or a song or a poem would almost certainly be regarded as fair use because you're only using a very tiny portion of the copyrighted work.
If you are not making money from it, that's also one of the four fair use factors. It's not determinative, but it's helpful.
You won't get it any trouble for doing this, but don't use too much.
I've done this in a few stories and haven't given it any thought. I'm writing a Star Trek cosplay story and lifting lines or slightly altering lines from various Star Trek Original Series episodes. I wouldn't worry.