Never did winning hurt so good for New York City FC.

Not only did Maxime Chanot and Alex Callens finish off the Philadelphia Union with their first MLS goals on Saturday, the two center backs were fortunate to still be standing at the finish to pull off their 11th-hour achievements.

Both played most of the match in pain, but they refused to come out.

Their fortitude and stubbornness turned out to be a blessing as they scored their first goals for the MLS side in the final 10 minutes — Callens in the 85th minute — turning a one-goal deficit into a dramatic 2-1 victory at Yankee Stadium.

“More than anyone else, I’m really glad that these two center backs scored because they’ve been working, sacrificing themselves for the team,” coach Patrick Vieira said.

After Wednesday’s disappointing 2-2 home draw with New England and last Sunday’s 3-1 loss in Atlanta, second-place NYCFC (7-5-3, 24 points) needed a victory to keep pace with Eastern Conference leader Toronto FC.

advertisement | advertise on newsday

“We wanted to show it was a mistake against New England and Atlanta,” said Chanot, whose problems started in the opening minutes when he was kicked in the back of his right thigh.

“After 10 minutes I couldn’t run,” he said. “I felt very bad in my legs, but you have to fight for yourself and for the team. I couldn’t leave my teammates like that.”

Callens went down in the 42nd minute after taking a hit on his shoulder.

“There was a lot of pain,” Callens said. “The doctor wanted me to go out, but I wanted to continue.”

Callens won that argument.

@NewsdaySports

Philly (4-6-4, 16) gave City a wake-up call on Fafa Picault’s 69th-minute goal as Vieira brought on Ronald Matarrita, Sean Okoli and Jonathan Lewis to give the team some fresh legs and a lift. It worked — spectacularly.

In the 80th minute, Chanot found space between two defenders to head Maxi Moralez’s corner kick past goalkeeper Andre Blake, whose fabulous saves kept Philadelphia in the match. Off another Moralez corner, Callens put home a rebound from close range for the game-winner in the 85th.

During his goal celebration, Callens’ teammates hugged him, but his shoulder didn’t hurt as much.

“It was adrenaline, so I didn’t feel it that much at that moment,” he said.

NYCFC gets some time off during a World Cup qualifying break, although Chanot Sunday flies off to play for Luxembourg at the Netherlands in a qualifier next Saturday.

advertisement | advertise on newsday

“I cross my fingers to make sure I can be fit for this and be fit for when I come back to New York,” he said.