A 5-alarm blaze that tore through a Williamsburg apartment building early Monday and killed two people was sparked by wiring in the basement ceiling, a FDNY spokesman said on Tuesday.

The blaze, which broke out at about 1:35 a.m. and took more than three hours to bring under control, spread throughout the three-story building and to at least one other building behind it, authorities said.

A woman was found on the second floor of the building on Richardson street, near Lorimer Street, police said, and pronounced dead at the scene. Firefighters later found a man in his 60s in the basement. Neither had been identified as of Tuesday afternoon.

The fire was deemed accidental, caused by the electrical wiring, the FDNY spokesman said.

A total of 198 firefighters responded to the flames, bringing it under control just before 4:50 a.m. Two firefighters sustained minor injuries, but were not hospitalized, authorities said.