The fire department was called to the scene on South 5th Street in Williamsburg at 2:45 Saturday morning.
Eyewitnesses say the victim, a man in his forties, was at a party in the building.
They say he may have been on the roof when he fell into the shaft.
A rescue worker was lowered into the shaft to pull out the man.
His injuries are not life-threatening, authorities said.