DETROIT, Mich. — Mayor Bill de Blasio would have fired the NYPD cop who engaged in a fatal struggle with Eric Garner if he could have, a surrogate for de Blasio’s presidential campaign said Wednesday.

“I have no doubt that if due process permitted an immediate firing, I believe the mayor would have fired him immediately,” Bronx Assemblyman Luis Sepulveda told The Post of Officer Daniel Pantaleo. “But unfortunately, these are things he cannot do, legally.”

Sepulveda — speaking from Detroit’s Fox Theatre hours before de Blasio was to take the stage for night two of the second round of Democratic primary debates — admitted that he hadn’t discussed the issue with the mayor, but said he knows his “philosophy.”

“I know his philosophy and his mindset,” said the Bronx Democrat. “I’ve been working with him for the last seven, eight years, and I’m pretty comfortable in saying that if he had the power to do [it] he would have fired him immediately.”

Federal prosecutors announced earlier this month that they would not pursue charges against Pantaleo for the July 2014 scuffle that began when the Staten Island cop tried to arrest Garner for peddling loose cigarettes.

The struggle ended with Garner’s death, and launched a firestorm of outrage that smoldered for years as federal and local authorities mulled their options.

The day after the feds handed down their decision, de Blasio refused to weigh in on whether Pantaleo should lose his job, leaving the call in the hands of NYPD Commissioner James O’Neill.

Pantaleo’s departmental trial wrapped in June, leaving O’Neill until the end of August to decide Pantaleo’s professional fate.

Hizzoner continued to stay his hand, even in a meeting with Garner’s grieving mom, Gwen Carr, who slammed de Blasio for “dragging his heels and obstructing accountability.”

City Hall kept up the poker face on Tuesday, saying only that de Blasio trusts the process.

“As the leader of this city, it is the mayor’s job to ensure due process and he cannot say or do anything that jeopardizes that,” said mayoral spokeswoman Freddi Goldstein. “At the end of that process, the mayor is confident there will be justice for the Garner family, for the first time.”

Sepulveda’s step inside de Blasio’s mind irked one police union official among an NYPD contingent that traveled to Detroit to air their grievances with de Blasio.

“We haven’t gotten support from this mayor,” said Police Benevolent Association treasurer Mark Hendry. “Officer Pantaleo was doing his job that day.”