A former NYPD official wants to force Mayor Bill de Blasio to testify on his behalf when he goes on trial in a hooker-fueled corruption case next week.

Lawyers for ex-Deputy Inspector James Grant served a subpoena on City Hall on Tuesday to force de Blasio to take the witness stand for the defense in Manhattan federal court.

Defense lawyer John Meringolo said de Blasio could help Grant by impugning the credibility of Jona Rechnitz, a former de Blasio donor who’s pleaded guilty to conspiracy and is set to serve as a key prosecution witness.

“[De Blasio] has publicly stated that Mr. Rechnitz is a felon and a liar, so who better than the mayor of New York City to attest to Mr. Rechnitz’ character?” he said.

Meringolo also insisted the move wasn’t a stunt, and vowed to fight any efforts by the city to quash the subpoena.

“It’s a lawful subpoena,” said Meringolo, who’s also a professor at Pace Law School in White Plains.

“[De Blasio] made these statements to the press, and he should make them to a jury.”

Last year, de Blasio blasted Rechnitz after Rechnitz testified at another corruption trial that he got access to the mayor by donating to his campaign, a non-profit the mayor set up and a 2013 effort to elect Democrats to the state Senate.

“Jona Rechnitz is a liar and a felon. It’s as simple as that,” de Blasio said during an October 2017 news conference in Brooklyn.

The mayor also called Rechnitz “just a horrible human being”

Grant is accused of performing official favors in exchange for gifts from Rechnitz and another former de Blasio donor, co-defendant Jeremy Reichberg,

The alleged payoffs include a group trip to Las Vegas on a private plan with a prostitute dressed as a flight attendant.

Jury selection is set for Monday.

In May, Grant subpoenaed testimony from about a dozen current and former NYPD cops, including Police Commissioner James O’Neill, and Meringolo said ex-Commissioner Bill Bratton was also served with a subpoena last week.

City lawyers have moved to quash those subpoenas, but a hearing on the matter hasn’t been set, Meringolo said.

In an email statement, de Blasio spokesman Eric Phillips said, “The Mayor wasn’t involved in the case and would have nothing to add but a needless sideshow.”

Earlier this year, a defense lawyer at the corruption trial of former Nassau County Executive Ed Mangano threatened to subpoena de Blasio to testify about his public denial that he took bribes from the government’s star witness in that case.

But lawyer Marc Agnifilo, who represented co-defendant and former Oyster Bay Town Supervisor John Venditto, rested his case without calling de Blasio to the stand.

Venditto was acquitted, while Mangano and his wife Linda scored a hung jury. Their retrial is set for next year.

Additional reporting by Yoav Gonen