I think 4 is a better game, but I did enjoy 5 more. I liked its heavier connection to the story over what 4 did, the soundtrack, the gameplay was pretty much just as good for me, Wesker, the huge b-movie bosses, etc. I also stand firm in the belief that 4 runs on for way too long, people often praise the pacing and while it is really good in general, I do think it's too long which for me is a pacing problem. 5 was just a leaner game for me.
That being said, again, I do think 4 is "better" but I prefer 5. I don't feel strongly enough about it to argue with someone who thinks otherwise as that's also perfectly valid. I also think 6 is fun as fuck, but I don't ever want another RE like it.