The city says the widow of a firefighter who perished in a blaze on the Harlem set of Edward Norton’s “Motherless Brooklyn” cannot sue for lack of a safe work environment — arguing that firefighting is inherently dangerous and a burning building is not a “place of employment.”

In May, widow Eileen Davidson asked a judge to allow her to sue the city, despite the fact that a deadline had lapsed, because she said new information surfaced following the release of the fire inspection report that showed the city was culpable in the death of her husband, firefighter Michael Davidson.

But a lawyer for the city, Urvashi Sinha, says in new Manhattan Supreme Court papers that “an employer cannot provide a safe workplace, free from recognized hazards, where the very nature of the work involves specific risks and hazards.

“Without a doubt, the risk of running out of air and being overcome by smoke is the kind of specific risk of firefighting that is inherent in the very task of firefighting.”

The city also argues that “a fire scene cannot be considered a ‘place of employment’ within the meaning of labor law.” If that were the case, then the city would be “liable any time a firefighter (or police officer) is injured while in the course of his employment,” Sinha wrote in the court documents.

The city claimed it didn’t have control over the circumstances that led to the fire but rather landlord Vincent Sollazzo and Norton’s production company Class 5 Inc. did.

“Sollazzo allegedly adjusted the boiler one day before and on the date of the fire. Class 5, upon an agreement with Sollazzo, altered the privately owned building to conform to a movie set and brought in film equipment,” the court papers say. “The city also had no control over any arrangements made between Class 5 and Sollazzo.”

The city will be prejudiced if the lawsuit is allowed to be filed so late in the game because it can no longer “investigate” as the location has since been demolished, Sinha argues.

Several lawsuits have already been filed against Sollazzo and Class 5 Inc., by Davidson and tenants.

The 773 St. Nicholas Ave. building was being used in filming the upcoming flick, which also stars Bruce Willis.

Davidson’s petition seeking to sue the city claimed that the FDNY had inspected the location three times before the fire, but a March inspection report revealed that the sprinklers didn’t go off during the blaze. And the Department of Buildings had open violations against the Sollazzo, one of which was for the boiler, which the inspection report says sparked the fire.

Davidson’s lawyer, Vito Cannavo, told The Post, he will “vigorously oppose the city’s response.”

“Firefighters are vested with a special right to recovery by law. The legislature determined that because they are in such dangerous conditions they should be protected from hazards that can be avoided,” Cannavo added.

Sollazzo’s lawyer, Geovanny Fernandez, declined to comment. A lawyer for Class 5 did not immediately return a request for comment.