It appears to have been sparked by an overloaded electrical outlet, the fire marshal's office said.
The fire started at 3:45 p.m. and quickly went to a 5th alarm at 520 West 139th St.
Heavy fire was visible inside the 7-story apartment building.
Authorities said the occupants of the apartment where the fire began left their door open while escaping. Residents are reminded to close the door behind them, as open doors allow fire to quickly grow and spread, which is what invesitgators say happened in this case.
Nineteen firefighters were treated for smoke inhalation - 11 at the scene and eight at Weill Cornell Medical Center. A civilian was treated for minor injuries.