The Stuyvesant Town and Peter Cooper Village residential development make up the largest housing complex in Manhattan.

Mayor de Blasio’s office inflated the benefits of a deal to keep affordable housing at the massive Stuyvesant Town complex in exchange for $220 million in taxpayer subsidies, the city’s budget watchdog agency found.

The 2015 Stuy Town sale was the biggest single deal done under de Blasio’s affordable-housing plan — but the Independent Budget Office said in a new report that the city is getting less from the agreement than it claimed.

Stuy Town and next-door residence Peter Cooper Village make up the largest housing complex in Manhattan, with more than 11,000 apartments.

De Blasio announced in 2015 that Blackstone Group LP would buy the sprawling property for $5.3 billion and agreed to restrict rents at 5,000 of its apartments for at least 20 years.

That adds up to 100,000 “apartment-years” of affordability. But according to the budget office’s report, the deal can be credited with only 36,000 years because the other 64,000 would have remained rent—stabilized even without the agreement and its massive subsidies.

“This was the biggest preservation deal done. We’ve put in $220 million, and it doesn’t look like we’re getting, based on our estimates, as much as the city had intended,” said IBO chief of staff Doug Turetsky. “Only about a third of the affordable housing can be chalked up to the deal.”

Under the arrangement, the 5,000 apartments will stay rent-stabilized at least until current tenants move out. After that, they’ll become affordable-housing with income restrictions under city rules. The “affordable” apartments won’t come cheap — with 4,500 of them renting for more than $3,500 a month for a family of three.

As part of the deal, the city gave the new owners $220 million in tax breaks and loans that don’t have to be repaid.

The benefits included $76 million in waived mortgage recording tax, and a $144 million loan that is interest free and will be forgiven over the course of 20 years. The de Blasio administration also agreed to support letting the landlords cash in on the sale of air rights from the complex.

Stuy Town is covered by a complicated set of rules after years of sales, bankruptcies and lawsuits that have roiled its long-time tenants.

According to the budget office, even with no action by the city, 1,800 apartments would have remained covered by traditional rent-stabilization rules for the next 20 years anyway. Despite this, de Blasio claimed credit for all 5,000 under his pledge to build or preserve 200,000 affordable homes.

In addition, many units would have stayed stabilized for part of the 20-year period — meaning 64% of the “apartment-years” the city claimed it protected would have had below-market rents regardless.

The average rent for a traditional rent-stabilized apartment at Stuy Town was $1,700 in 2015, which could rise to $3,200 by 2035. Rent-stabilized apartments do not have income restrictions.

The de Blasio administration disputed the IBO analysis.

Eric Enderlin, who helped negotiate the deal for the city and is now president of the Housing Development Corporation, said for the $220 million the city is sinking in, residents will save $505 million in rent compared with what they would have paid without the deal.

“We know that the average New Yorker doesn’t look at that and say that’s affordable, but it’s in a very high-cost part of Manhattan,” he said, noting some apartments in the complex can go for as much as $8,000 to $10,000 on the free market.

“We strongly disagree with it,” he said of the IBO report. “They’ve created this kind of academic, ivory tower model ... People live in these apartments, and you can’t know which apartments are going to be vacant.”

Susan Steinberg, the president of the Stuyvesant Town-Peter Cooper Village Tenants Association, sided with the city, saying without new protections tenants feared the landlord would harass residents to leave to get out of rent regulation. The budget office says it accounted for that in its analysis.

“We could have expected more aggressive and unscrupulous ways to get people out of their rent-stabilized units. Our neighbors have seen that movie before, and it was a disaster for our community and for the city,” Steinberg said.