The elevator key is a special implement used during the servicing and inspection of elevators, as well as during the rescue of passengers stuck inside.
As far as I know, there are two different kinds of elevator keys; the drop key, and a newer type that fits in a crescent-shaped hole.
The elevator key is usually located in a small box at the lobby entrance to the shaft.
On the backside of the elevator's outer doors is a mechanism, consisting of several levers and an interlock, which holds the doors closed when the elevator is not present. The interlock mechanism is just a plastic hook attached to a lever on each door, which drops into place behind a metal tab. It is released either by the door operator on the elevator cab or the key lifting the lever, allowing the hook to clear the tab.
The drop key, which fits in a round hole, has a pivoted section at the end. It is inserted straight, and the end drops down. It is then rotated until the pivoted section catches behind one of the levers and releases the interlock, then pulled out of the door. I am not sure how the crescent shaped key works, as I've never examined the mechanism in one of those doors.
Due to the recent dangerous hobby of elevator surfing, elevator keys are usually kept in a locked box, accessible to maintenance and rescue workers.