The blaze broke out around midnight Sunday in the impoverished Tondo district and raged for more than seven hours, spreading through 47 acres of the 121-acre compound of the former BASECO shipyard.
The fire was believed set off by a gas tank that exploded, officials said.
Firefighters struggled to gain access to the blaze in the overcrowded area where ramshackle homes line passageways that are too narrow for firetrucks to pass, Social Welfare Secretary Corazon Soliman said.
Twenty-seven firetrucks and a navy fire boat on a nearby river assisted in the operation.
At least 23 people were brought to various hospitals for injuries, but no deaths have been reported so far, the Office of Civil Defense said.
At least 2,500 homes were burned down, leaving 5,006 families - or 25,030 people - homeless, it added.
President Gloria Macapagal Arroyo arrived at the scene early Monday and supervised the transition of a gym into a center to accommodate the homeless, Soliman said.
``The city of Manila is rich, so they will lead in giving assistance, but if the need is great and they can not do it alone, the national government will come in,'' Arroyo told ABS-CBN television during her early-morning visit.
Defense Secretary Eduardo Ermita, also head of the National Disaster Coordinating Council, reported later in the day that eight evacuation centers have been set up for displaced families, and more evacuation facilities might be put up as the need arises.
Television footage showed grief-stricken families milling around the compound with a few bundles of clothes and meager belongings saved from the blaze.
``We lost our home, everything was gutted, nothing was left,'' a crying woman told ABS-CBN.