New York Mayor Bill de Blasio called the incident "a tragedy of the worst kind" because the smell of gas was detected "but there was no indication in time to save people". His office said nine residents from the two collapsed buildings were still unaccounted as night fell.
The new, fifth fatality was a body pulled from the rubble, the fire department said early on Thursday, CNN and other news outlets reported.
The death toll was described as likely to rise.
Firefighters battled throughout the afternoon to extinguish the heavy fire in East Harlem, where witnesses compared the scene of twisted metal, thick white smoke and dusty rubble to a war zone.
The explosion sparked inevitable reminders for some New Yorkers of the 9/11 terror attacks in 2001 that brought down the Twin Towers. Other witnesses said it felt like an earthquake.
There were 15 apartments in the two buildings that collapsed, de Blasio and city officials told reporters near the scene at 116th Street and Park Avenue, a mainly Latino community. Around 15 minutes before the blast, energy company Con Edison received a call from an adjoining apartment building alerting maintenance staff to the smell of gas.
The explosion struck around 9:30 am (1330 GMT) and the New York Fire Department said firefighters were on the scene two minutes later.
"There was a major explosion that destroyed two buildings. The explosion was based on a gas leak," de Blasio said.
It was the first deadly disaster of its kind to strike the city of eight million since the Democrat took office in January and will raise concerns about safety in less affluent neighborhoods.
"There is a tremendous amount of anxiety, but suffice it to say that every effort is being expended to locate each and every one of these (missing) individuals," the mayor said.
The Mexican Foreign Ministry said two women who were among the dead were Mexicans, along with one of those injured. Lamenting the "deeply unfortunate incident," the ministry said in a brief statement that Mexican consular staff remain in close contact with New York authorities.
Four different hospitals told AFP they treated a total of 63 patients, the vast majority with minor injuries.
A spokesman for Mount Sinai hospital said 22 people, including three children, were treated. Nineteen were discharged. One woman was critical but stable with head trauma and two other people were still being evaluated in the emergency room, the spokesman said.
The New York City Health and Hospitals Corporation tweeted that its Harlem and Metropolitan Hospitals received a total of 30 patients who suffered a variety of injuries.
A spokeswoman for New York-Presbyterian Hospital said that doctors received 11 patients, with 10 still under evaluation.
Hundreds of police and more than 250 firefighters were on site with emergency trucks, as a dense column of smoke spewed into the sky over the Metro-North railway line. The blast forced the suspension of train services in and out of Grand Central Station in midtown Manhattan for part of the day.
Jazzmen Arzuaga, 30, said she was at work at a hospital when her wife rang to tell her what had happened. "She called me and told me 'Oh my God, you need to come home now, it's like World War II, people are dying, there was an explosion.' I just literally ran," she said.
The couple live across the street from the blast.
Arzuaga's wife Jay Virgo, also 30, said she was lying in bed when the blast threw her to the floor. "There was glass everywhere, huge pieces of glass. It just looked crazy," she said.
Con Edison confirmed that a resident reported smelling gas inside the apartment building at 1652 Park Avenue.
"Our crews are checking our gas lines and working to isolate any leaks that they find and they're working closely with the FDNY to make the area safe," company spokesman Bob McGee said.