I had a short internal debate with myself when I was shopping recently as well.
Both cameras use the same 16.2 sensor, so image quality should be similar if not the same on both.
There is a significant price difference. I kept thinking about lenses being more of a long-term investment than camera bodies, and thought perhaps the money I'd save on the D5100 body would be better spent on glass.
In the end, I went with the D7000 for the following reasons:
1) INTERNAL FOCUS MOTOR. I already had some AF Nikkors that would not have worked on the D5100 body with it's lack of a built-in motor. To replace these lenses with their AF-S counterparts would have cost me more than what I'd save by buying the D5100.
2) TWO COMMAND DIALS. Absolutely invaluable for keeping quick and separate control over some camera functions - particular shutter speed and aperture when in manual mode.
3) DEDICATED BUTTONS. The D3100 improved the Nikon menu structure significantly, but the D5100 and D7000 are clinging to a menu system that (in my view) needs to be blown up and started from scratch. Yes, you get used to it in time like all things, but it reminds me of a house that's been added on to over the years. The D7000 has several important functions brought out to dedicated buttons, and that's invaluable. Anything that keeps you out of the menus is a good thing in my opinion.
4) DUAL SD CARD SLOTS. Granted, card failure (with good brands) is rare, but having the option to back up files in real time has value. If Card 2 is set up as a backup, you can pull it out, pop it in the laptop, do some transfers, reviews, or edits, and still have a card in the camera. I have mine set up to shoot RAW on Card 1 and JPEG on Card 2.
5) BUILD QUALITY/CONSTRUCTION. Depending upon how you use your camera, this may make no difference at all. I baby my gear and don't go rock climbing with it - not my style. But if it should slip out of my hands or accidentally bang into something, I like the idea of something a little more solid. Was it a deal breaker for me? No, but it's nice piece of mind and feels good in-hand.
6) ARTICULATED SCREEN. If I was shooting a lot of video, I think I would appreciated this option, but I don't. In fact, I'm not even a huge fan of live view. I prefer to look through the viewfinder (guess I'm a little old school). I also worry about those screens adding an additional point of failure to the camera. How many twists and flips before there's a problem? Again, maybe a needless worry, but my personal preference is for less complexity here.
Would I hesitate to recommend a D5100 to anyone, particular if cost is an issue? Not at all! But the D7000 had some definite advantages for my shooting style and existing stock of lenses that made it the right choice for me.