You can very well take night shots like this with D5100. I'll explain from my experience when i took this pic.
Timing is very important in city-light shots. You can see the deep-blue/purple color of sky in the example picture you posted. You get this color a bit after sunset (Twilight). Unlike other landscape shots, you need a clear sky. So plan your trip to the observatory accordingly.
A wide angle lens is the most suitable for city-light shots. Apart from getting a wide viewing angle you also get a good depth of field.
What you need is a large depth of field. Setting it more than f/8 on a wide angle lens gives you good depth of field. Few city-light shots look particularly good if you go all the way to f/22. You get star burst from light. But this depends on your lens.
I exposed my light meter off the blue sky. It gave me some 10s of shutter speed. Generally it is a good idea to meter off the blue sky.
You definitely need a tripod or a solid support for your camera. Exposure time is going to be much more than you can hand hold the camera.
- Observatories have big glass windows. And at night they start reflecting room lighting. Be ready to post-process them out.
- Shoot raw. You might want to change WB later.
- Use lens hood.
About the actual image
Looks like the photographer has set a cooler WB on the image. I reduced WB of my image to get this look:
The EXIF data of image shows it is shot at 1/30th of second. To compensate this faster shutter speed aperture is increased to f/2.8 and ISO bumped up to 1250. The reason of using a fast shutter speed is not very clear to me. It could be because tripods might not be allowed (?) in John Hancock observatory, Boston.