Is this lens compatible with the Nikon D5100?

Is the Nikon Ai-s LENS SERIES E 50mm f/1.8 compatible with my Nikon D5100?

It won't allow AF, but may allow metering. You certainly won't damage your camera by mounting it.

NO.
In order to use AI or AI-S lenses you need at least a Nikon D200 or better in order to use the in-camera light meter.
Your camera is an entry level camera and uses AF-S lenses or AF lenses if you do not mind manually focusing the lens using the electronic rangefinder.
NOTE: Any Nikkor auto-focus lenses other than Nikkor AF-S lenses will not auto-focus using your fine D5100.AI-S will not meter with your camera, but if you have an external light meter, you can use is in the manual mode
NOTE2: Nikkor Series E lenses were only built for a short time and were made for the low priced, short lived Nikon EM cameras and was intended to be used by inexperienced photographers who could not easily master the intricacies of shutter speeds and f-stops.

It should fit. In manual mode it should work. It will have no metering or autofocus with the D5100.
It might be a good night scene lens, since you have to trial and error exposure anyway, and it should dial to infinity. However, that is often the kind of scene for which wider angles are preferable.
The cameras it was designed for had optical aids to manual focusing like split rings and microprisms. Digital SLR's are harder to manually focus accurately.
Ken Rockwell writes favorably about the quality of the lens. With anything used, there's always a question of whether it is in good enough condition.
http://www.kenrockwell.com/...50f18E.htm
- Is this Nikon Nikkor-S 1:1.4 f=50mm lens compatible with a Nikon D5100?
- Is the Nikon 10.5mm f/2.8G ED AF DX Fish eye Nikkor Lens compatible with the nikon d5100?
- Does Nikon D5100 compatible with Nikon AF Zoom-NIKKOR 70-300mm f/4-5.6G Lens?
- Nikon 50mm f/1.8D Nikkor AF Lens compatible with Nikon D5100?
- Are these lens compatible with Nikon D5100?