As many as three manholes started smoking on 75th Street near 88th Avenue in Woodhaven just before 1 a.m.
Flames shot from the street, setting two parked cars on fire and badly damaging both of them.
The fire also forced elevated levels of carbon monoxide into a nearby home.
Five residents, including children, were taken to Jamaica Hospital for carbon monoxide exposure.
"Fire came down from the bottom up and blew up two cars on the side on 88th Road, and then the fire department was here and they turned it off, and we all went downstairs because of the smoke," the grandmother of the victims said. "And then again we heard another boom, and it exploded again from down underneath. And then more smoke came out, and my daughter with her three kids had to go to the emergency room."
The cause of the manhole fire was under investigation.
A handful of residents were left without power.
A Con Edison crew responded to fix the problem. Spokesman Allan Drury said the fire resulted from "a failure of underground delivery equipment."