Didi Gregorius, Jose Alvarado and Ian Kennedy — three Phillies who have struggled the season — were right at the front of Friday’s tense, series-opening 4-3 win in New York.

Gregorius had his most impactful game of 2021 with a web gem that helped keep the Mets off the board in the seventh inning and a crucial two-out RBI double in the eighth.

Alvarado entered with two men on, nobody out, and the game tied in the sixth inning and recorded three quick outs when it looked like the Mets would go ahead.

Kennedy picked up a four-out save after Archie Bradley allowed two runs in the eighth to make it a one-run game.

The Phils (75-72) began and will end the night no more than three games back of the Braves in the NL East. They’ve won three in a row. The Braves are in San Francisco for the first series of an 11-game West Coast trip.

Zack Wheeler started against his former team and cruised for three innings before losing command in the fourth. He gave up two singles, walked a batter, and hit a batter but minimized the damage, giving up just a run.

Wheeler has three starts left; next Wednesday at home against the Baltimore Orioles, the following Tuesday in Atlanta, and the final day of the season in Miami.

Wheeler has surpassed 200 innings for the first time in his career.

The Phillies had to piece together the final three innings because Hector Neris had pitched three innings the last two days. Neris has been a working for the Phillies, averaging less than one full day of rest between appearances since August 27.

They did so without manager Joe Girardi, who was ejected in the seventh inning after a check swing call went against Matt Joyce. Girardi fumed, yelled “that’s bull s***” a handful of times at the umpire who tossed him and was still displeased as he went down the dugout steps. The toss did appear to be quick but we don’t know how much was said before.

Gregorius helped Sam Coonrod pitch a scoreless seventh by extending fully on a dive to his left, turning and flipping the ball on a hop from a grounded position to Jean Segura for a force-out.

The Phillies scored their first run in the second inning when J.T. Realmuto singled, stole second, tagged up to third, and touched home on a Freddy Galvis sacrifice-fly.

A half-inning after the Mets tied things in the fourth, Brad Miller homered to put the Phillies ahead.

Miller, whose seventh-inning single helped the Phillies score again, has 19 home runs in 336 plate appearances this season. Nobody in the majors with so few plate appearances has that many home runs in 2021.

Matt Vierling produced an important insurance run with a bases-loaded sac fly off of Seth Lugo in the seventh and Gregorius added another in the eighth after Bryce Harper and Realmuto stranded runners on the corners.

Harper went 1-for-4 with a double. He has an extra-base hit and/or an RBI in nine straight games, 11 of 12, and 18 of 22.