The owner of an Inwood building where a deadly fire killed three people this week is facing a lawsuit for unsafe conditions at a neighboring building.

The fire broke out Monday at a building on Dykman St., where investigators are still working to determine the cause.

FDNY officials said the fire spread spread rapidly because apartment doors were left open as residents fled, allowing flames and smoke to move through the building.

What You Need To Know

The city sued landlord JanJan Realty Corp. days before the fire at one of its Inwood buildings for unsafe conditions at its next door space

Three people were killed in the fast-moving blaze early Monday morning

The neighboring building has more than 200 housing violations, including fire hazards

Authorities identified two of the victims as Yolaine Diaz and her mother, Ana Mirta Lantigua. A third victim has not been identified. Five others are in critical condition.

“The minute I saw it, I thought I was going to get sick, and I remembered my blood pressure pill and took it and tried to breathe in and be strong,” said Ylka Diaz, a cousin of Yolaine Diaz. “It’s very hard, and it’s going to take a long time to heal because she was such a happy person.”

A week before the fire, building owner JanJan Realty Corp. was sued by the city’s Department of Housing Preservation for allegedly failing to repair dangerous conditions at the apartment building they also own next door.

That building has more than 200 open violations, including leaking and collapsed ceilings, missing window guards and fire hazards such as obstructed exits, according to housing officials.

The department alleges the building owner failed to make repairs for months or years beyond what is required by law. Officials said the owner was intentionally neglecting repairs “as part of an intentional and aggressive campaign to harass and displace rent stabilized tenants.”

The building where the fire occurred was not included in the lawsuit but has more than 100 open violations, including issues with self-closing doors, ceilings, mold and pests, according to city records.

JanJan Realty Corp. could not be reached for comment.

An investigation into the fire’s cause is ongoing.