On a day in which New York City FC finally won a home game after a long wait, moved to within two points of the first-place Philadelphia Union and saw its three Designated Players score, David Villa was steaming mad.

After the final whistle of City’s 3-2 win over Philly Saturday, the team captain was visibly upset about its chronic late-match problems holding onto leads.

NYC FC earned its first three points at Yankee Stadium since April 30, but that wasn’t good enough. Villa was seen complaining to Frank Lampard after the hosts almost allowed their three-goal, second-half lead slip away.

City (5-5-6, 21 points) snapped a four-match winless skid before a crowd of 27,456. Philly (6-4-5, 23) had its eight-game streak come to an end.

“He was frustrated . . . that we didn’t close out the game,” Lampard said. “We’re all passionate here and David’s passionate. We didn’t want to be in a position from being three-nil to having a nervous last five minutes. That’s a responsibility of all of us. I would rather have David caring about it in that way rather than not caring. “

Villa, who usually is accommodating after losses, declined to talk to the media.

advertisement | advertise on newsday

He could have talked about how he and the other two DPs — Andrea Pirlo and Lampard — came up with big-time performances in the wake of City being eliminated from the Lamar Hunt/U.S. Open Cup by the Cosmos Wednesday.

“This is what you expect from the leaders,” coach Patrick Vieira said. “Everybody felt really concerned about us losing in the cup. I was looking for a reaction . . . That’s fantastic.”

Lampard, in his first start of the season, scored off a deflection of Tommy McNamara’s shot in the eighth minute. Villa hammered home his league-best 11th-goal off a Jack Harrison back-heel pass after the rookie made a 40-yard run in the 21st minute.

Pirlo tallied his first MLS goal, powering a 20-yard free kick into the right corner for a seemingly safe 3-0 lead in the 50th minute

That didn’t last long.

@Newsday

“We didn’t make it easy for ourselves,” Vieira said.

Roland Alberg converted a penalty kick in the 55th minute. Defender Jason Hernandez was dismissed with his second yellow in the 85th minute, forcing City to play a man down the rest of regulation and five minutes of stoppage time. City defender Frederic Brillant scored his second own goal of the season in the 88th minute for a wild finish.

“We concede a goal and all of a sudden we’re a bit panicky,” Lampard said. “We need to work on that a little bit more and react in a better way. But . . . we got the three points that we desperately needed today.”