The lightning strike occurred around 2 a.m. at the six-story building at 214 Rockaway Parkway​ in Canarsie​, officials said.

Three firefighters suffered minor injuries in the four-alarm fire, which took about an hour to get under control.

Two other people also were seriously injured in a Far Rockaway blaze less than two hours later, authorities said.

That fire started on the second floor of an eleven-story apartment building on Beach 56th Street near Ocean Promenade around 3:30 a.m., officials said.

About 60 firefighters battled the blaze for 45 minutes before it was placed under control, authorities said.

The two victims were rushed to area hospitals, where they were listed in serious condition. One of the victims is being treated at St. John’s Hospital and the other at Nassau Medical Center, authorities said.