The city is ponying up $418 million more for the subway, despite months of Mayor de Blasio insisting the state should pick up the whole tab.

The $168.3 billion budget Gov. Cuomo announced Friday night included money for the MTA’s $836 million subway-rescue effort — by giving the state power to take funding from the city if it doesn’t willingly cough up half the cost.

For months de Blasio said the city wouldn’t provide additional cash without a guarantee the money would be used for the subways and no other MTA projects.

The feuding pols both took victory laps on Saturday.

“We finally got the city to pay half the Subway Action Plan, hurray,” Cuomo said at an Easter open house at the governor’s mansion.

A de Blasio spokesman crowed, “This budget appears to respond to the mayor’s demands on behalf of the city’s straphangers. There are no excuses left for the governor to hide behind. He must do his job and fix the subways.”

A senior Cuomo administration official shot back, “They’re trying to put their spin on it . . . [de Blasio is] trying to claim victory when he was wholly defeated,” adding the mayor has ignored his “obligation” to fund half the plan.

But de Blasio’s office said the state budget appeared to include the subway “lockbox” he’s pushed.

“When it comes to the subways, Mayor de Blasio has always demanded two things: significant movement by the state toward a real plan, and a dedicated lockbox so city riders’ money goes toward fixing city subways,” City Hall spokesman Eric Phillips said.

Other budget items were a body blow to de Blasio, including a new mandate that the city get state approval for its homeless outreach efforts before getting state funds.

NYC schools will get $334 million more from the state, but the budget requires the city disclose spending per school. Cuomo officials say the city’s current reporting only shows $9 billion of the $26 billion spent on education.

The budget also allows the state to use eminent domain to develop the area near Penn Station — which the de Blasio administration has opposed — and allows the easement the city tried to block to complete the AirTran from LaGuardia Airport to the Long Island Railroad.

“We definitely know there’s not any love lost between the mayor and the governor and any budget item obviously reflects your morals,” Fordham University political scientist Dr. Christina Greer said.

The spending plan also includes an income tax cut for middle-class New Yorkers, saving taxpayers an average of $250 each in 2018. By 2025, the savings would reach an average of $700 for joint filers making between $26,000 and $300,000.