The flames broke out on West 240th Street just after 8 a.m.
Crews had to use tower ladders to remove trapped residents from the high-rise building.
They also had to escort them with their pets out of their homes.
It took 12 FDNY units and 60 firefighters to get it under control.
All of the injuries were believed to be minor.