Instead of connecting the elevator's winch to a motor, connect it to a Continuously Variable Transmission.
Connect this CVT to a really tall drive shaft, which goes down from the winch & CVT at the top of the elevator shaft, to a utility room at the bottom of the shaft.
At the bottom of the drive
shaft, connect a positive displacement reversible water pump -- a pump which can either send water up, consuming power, or which can lower water down, generating power. This pump should be connected to two water storage tanks -- one at the top of the building, and the other at the bottom.
When the elevator is going up, the pump (acting as a motor) lowers water from the upper tank to the lower, generating power. The CVT is adjusted to the correct gear ratio so that the torque produced by the pump to produce the right amount of lifting power.
When the elevator is going down, the pump lifts water from the lower tank to the upper. Again, the CVT is used as necessary to control the rate of power transferred from the elevator to the pump.