Firefighters say when they arrived the fire had burned through the roof and filled the top three floors with flames.
The 2 residents and 2 firefighters were taken to the hospital with non-life threatening injuries.
Fire marshals determined the fire was caused by large appliances plugged into a power strip.
FDNY fire marshals, as well as the Fire Safety Education unit, are urging all New Yorkers to never plug large-draw electrical appliances - such as televisions, air conditioners, clothes dryers, refrigerators and freezers - into power strips and extension cords.
These types of appliances require a lot of energy, which easily can cause power strips or extension cords to overheat, melt or ignite.