NEW YORK -- The final three outs were shaping up Friday night to be a good chance for Ian Kennedy to re-enter the ninth-inning cauldron with relative ease. His last two save chances ended in crushing fashion, so it would have been nice to give him a save opportunity as comfortable as possible.

But then a three-run Phillies lead was trimmed to one with two outs in the eighth inning, the Citi Field bullpen door opened, and Kennedy came through. There was no chance to ease Kennedy back in. He was tossed back into the fire, asked to record the final four outs of a 4-3 win over the Mets while protecting the narrowest of leads.

Such is the life of a closer in a playoff race and Kennedy walked that tightrope just fine this time. He ended the eighth with a strikeout, stranding the tying run on second after Archie Bradley allowed two runs, before retiring the three batters he faced in the ninth on outfield flies.

The Phillies started Saturday just two games behind first-place Atlanta in the NL East, following the Braves’ 6-5 loss to the Giants in 11 innings at San Francisco. They were 2 1/2 games behind St. Louis in the wild-card race.

“Coming out of the bullpen or just pitching and playing in this game in general, you have to quickly move on,” Kennedy said. “They’re tough and it really [stinks] when you blow a game. It’s probably one of the worst feelings you can have. I take a lot of pride in trying to help the team as much as I possibly can. ... It hurts when you don’t do your job.”

The bullpen has been the source of much angst this season. It leads the majors in blown saves and has the sixth-highest ERA, but it held on Friday night. José Alvarado recorded three big outs in the sixth after coming in with runners on first and second, Sam Coonrod handled the seventh, and Kennedy finished the job after Bradley stumbled.

“He’s a veteran and he knows how to bounce back,” manager Joe Girardi said of Kennedy. “He’s been through this before. He’s been pitching a long time. He’s pitched in New York and he’s pitched all over the place. He just knows how to bounce back. You have to be able to turn the page if you’re a closer.”

Zack Wheeler, who had pitched at least six innings in 14 straight starts and has averaged nearly seven innings per start since joining the Phillies, recorded just 15 outs before he was lifted for Alvarado with two on and no outs in the sixth inning. The relievers bailed out the starter who often gives them an easy night and kept the team’s postseason dream churning.

“It sounds cliché, but a lot of guys keep saying that we just have to focus on what we’re doing,” Kennedy said. “The Braves are playing the Giants, who are the best team in baseball, but we still have to go out and perform. It doesn’t matter who we’re playing. It doesn’t matter if they’re in last place, first place, second, or third. It doesn’t matter. We have to do our job and not really watch the scoreboard.”

» READ MORE: Phillies remain committed to bullpen games after latest flop

Alvarado’s big outs

The public-address announcer had yet to introduce Alvarado when the sharp-eyed fans spotted him running from the bullpen and showered him with boos.

The moment -- runners on first and second with no outs in the sixth inning of a one-run September game -- was already tense enough. And now Alvarado was the enemy of Queens.

Alvarado had a few spats early in the season with the Mets and remains something less than a fan favorite here. He didn’t seem to mind. Alvarado yielded a double play by Michael Conforto on his first pitch and was soon hopping off the mound with his fist pumped after ending the rally with a strikeout.

“Huge,” Girardi said. “That double play ball. That’s three big outs.”

Didi’s glove

Shortstop Didi Gregorius was facing left field and laying on his stomach when he fielded a sharp grounder to his right in the seventh inning. There was little chance for him to get the lead runner at second base, yet he found a way.

“When he dove, I was like ‘OK. How is he going to get this to Jean?’ But I’m thinking like me, I would maybe turn over,” said first baseman Brad Miller. “But no, he was like, ‘I’m just going to backhand it.’”

Gregorius, whose defense has improved recently, flipped the ball behind his back to Jean Segura and the second baseman stretched from the bag to glove the ball on one hop for the second out of the inning. It was one of the team’s best defensive plays of the season and it helped stymie a Mets rally.

“I went back to my old ways of fielding,” Gregorius said earlier this week to explain his improved defense. “Not what they wanted me to do in the beginning. I think that’s what changed.”

Gregorius subsequently doubled in a run in the eighth to put the Phils ahead by three, providing the run that ended up being the difference after Bradley’s rough inning.

“One of the best plays I’ve ever seen when you think about it,” Girardi said. “I don’t imagine they run many option plays in Curaçao. But it was an option flip and it was a nice flip by Jean. Just an unbelievable play. That’s the difference in the game. That play right there.”

Girardi tossed

Girardi was ejected in the middle of Matt Joyce’s at-bat for arguing with the third-base umpire after he said Joyce’s check swing was a strike in the seventh inning. Girardi, who seemed to have a point, was visibly furious. It was his fourth ejection of the season, one shy of his career high.

“I showed him what he did, what I thought he did, and then I put my hand up and he tossed me,” said Girardi, who was ejected before leaving the dugout. “When I ran out there, he said, ‘You can’t put your hand up.’ I’m like, ‘I guess that’s a rule here that I’m not aware of.’ Way too quick. You have to understand that these are important games and those are important runners on base. I sure as heck didn’t think he went and I sure as heck shouldn’t be tossed for putting my hand up. If I put my hand up and put four fingers down, that’s a different story.”

Miller time

Brad Miller crushed a splitter in the fifth inning to put the Phillies ahead by a run, answering back one inning after the Mets tied the game. Miller had two hits and his 443-foot shot was his 19th homer of the season. The Phillies will need more than Bryce Harper to carry them this month as it’ll take nights like Miller’s to push them to October.

“I think that’s the formula. You want to win consistently, you don’t want to just rely on one guy. Luckily, we have a pretty good one,” Miller said. “But if you want to win three, four, five games in a row and win series all the time, I think it has to come from everybody.”

Wheeler’s night

Wheeler was exceptional through the first three innings before his command seemed to dip. The Mets scored a run off him in the fourth and chased him in the sixth by starting the inning with two singles. Wheeler, who threw 93 pitches through five-plus innings, failed to give the Phillies the length they expect when he starts and the length they needed after using seven relievers on Thursday.

“I didn’t throw strikes like I wanted to,” Wheeler said. “It kind of got away from me a little bit. The front shoulder was kind of flying open a little bit. I just couldn’t command the ball like I wanted to. ... It’s an easy fix going into the next start.”

Wheeler leads the majors with a career-high 200 1/3 innings, a workload that may be wearing on him. The Phillies are trying to keep his pitch count under 100 in each start this month. Wheeler said earlier this month that it’s not his velocity that’s affected by fatigue, but command. That seemed to be the case Friday.

“It’s late in the season so you can call it like you want it, but I felt fine,” Wheeler said.

Realmuto’s OK

J.T. Realmuto’s elbow injury proved to be little more than a scare as the catcher was in the lineup Friday, a night after leaving the game with a swollen triceps after being hit by a pitch.

He dropped a single into right field in the second inning, promptly stole second, moved to third on a fly ball, and scored on a sacrifice fly. Realmuto is already playing through a shoulder injury and he seemed to avoid having another injury to overcome.