Hillary Clinton let Bill de Blasio down during the 2016 election, the mayor says in a new book.

In a post-election interview in the book, de Blasio tells author Joseph Viteritti that had Clinton listened to him and other progressives, she could have won.

In one remark, he zings both Hillary and Bill Clinton.

“Although I opposed the DLC [pro-Bill Clinton] (Democratic Leadership Council) and its centrist politics, I had real hope for Hillary,” de Blasio says in Viteritti’s “The Pragmatist: Bill de Blasio’s Quest to Save the Soul of New York.”

“I thought she would eventually take a stronger position on income inequality. She could have generated more support if she had taken a stronger stance, and done it sooner.”

De Blasio, whose complicated relationship with the Clintons goes back more than 20 years, ran Hillary Clinton’s successful 2000 Senate campaign in New York and had worked as regional housing administrator in Bill Clinton’s administration. The former president swore him in as mayor.

De Blasio admitted there were tensions within Hillary Clinton’s Senate campaign, in part because DC-based moderate-centrist Clintonites were allowed to overrule him on key decisions, even though he was the campaign manager.

“There was a split within the campaign between the progressives and the moderates, and the latter won out,” he told Viteritti, a professor who chairs Hunter College’s Urban Planning and Policy Department and had worked for the Koch administration.

The author notes de Blasio’s belated endorsement of Hillary Clinton over his “philosophical compatriot” Bernie Sanders must have been “soul wrenching,” but says that in the end, the “pragmatic” and “loyal” mayor fell in line.

“Even as a mature political actor, this man who once dabbled in Marxist causes remains an odd player on the American scene,” Viteritti writes, referring to the mayor’s support as a young man for Nicaragua’s Sandinista regime.

But de Blasio paid a political price for his hesitation in endorsing Clinton.

She rejected his request to attend an Iowa forum during the primary season and gave former Mayor Mike Bloomberg, a moderate Republican-turned-independent, a more prominent speaking role at the Democratic nominating convention than she did de Blasio, which the author describes as an “unusual snub” for a sitting New York City mayor.

In “The Pragmatist,” Viteritti says de Blasio has ushered in a new progressive era in New York City politics.

He gives the mayor kudos for instituting a popular universal pre-K program and plowing more funds into programs to aid the needy, including subsidized housing, homelessness prevention, mental health treatment, public hospitals and legal services for the poor.

And for all the political spats de Blasio has had with Gov. Andrew Cuomo, it is the mayor who mostly moved the governor to the left on issues such as pre-K and raising the minimum wage, Viteritti argues.

But Viteritti cites areas where de Blasio went off the rails, including the mayor’s “animosity” toward charter schools.

Viteritti lists stats showing how lower-income black and Hispanic students in charter schools fare better than kids in nearby traditional public schools.

“No educator or political leader who seeks to improve educational opportunities for low-income populations can ignore such data,” he said.

And pointing out that many politicians on the left are hostile to religious institutions, Viteritti praises de Blasio for working with leaders like Cardinal Timothy Dolan and faith-based organizations to help the unfortunate.

But he says de Blasio strayed by allowing ultra-Orthodox rabbis to self-police the religious circumcision ritual called metzitazah b’peh even though it has caused herpes and even deaths in newborns.

“De Blasio’s compromise stank of political opportunism,” he writes.