NEW YORK — Kyle Gibson had thrown 82 pitches Sunday night and survived a scare to keep the game tied through six innings. So it seemed like his night was finished when the pitcher’s spot in the batting order came up with two outs and the score tied in the top of the seventh.

But Joe Girardi, working with a taxed bullpen in an eventual 3-2 loss to the Mets, wanted to push Gibson for three more outs. So he let him strike out on three pitches for the second out of the seventh. Then Gibson gave up the lead by allowing a leadoff homer to Jeff McNeil in the bottom of the inning.

“I felt good and it’s always nice when Joe has that kind of confidence to let me go back out there and attack the bottom of the lineup,” Gibson said. “I probably threw one of the only change-ups that I didn’t throw well on the day. Just more frustrating because I felt like it could have been the right pitch if I executed it at the bottom of the zone and away.”

The Phillies were short some of their high-leverage pitchers as José Alvarado, Ian Kennedy, and Sam Coonrod each pitched in the first two games of the series and Héctor Neris pitched in three of the previous four games. The next nine outs would have been a challenge if Girardi lifted Gibson.

“I was going to only use Hector if we closed,” Girardi said. “I didn’t have Kennedy. I didn’t have Alvarado. Coonrod was maybe one out. We were kind of limited.”

» READ MORE: Bryce Harper says he doesn’t know his stats, but here are five that make him an MVP favorite

But the Phillies may have entered the bottom of the seventh if a pinch-hitter came through as the next three batters — Jean Segura, Freddy Galvis, and Bryce Harper — reached base after Gibson’s strikeout before J.T. Realmuto ended the rally with a groundout.

The short bullpen was a byproduct of playing 17 games in 18 days and the fact that a starting pitcher has not pitched seven innings since Aug. 25. Gibson was the second starter to reach the seventh in the last 23 games. That workload — along with a bullpen game every fifth day — was eventually going to catch up with the Phillies.

“We’ve been in a lot of close games and we’ve been winning lately. That’s all part of it, too,” Girardi said. “It gets that way sometimes. We should have a much fresher bullpen going into Monday. Start a new series and get right back after it.”

The Phils almost overcame that seventh-inning homer in the ninth when Bryce Harper ended the game with a deep fly out to right field. Girardi said knew immediately that the fly ball was too high, but it left the bat loud enough for him to hope.

“So you kind of go ‘Come on, come on, come on’ but the ballpark plays big too,” Girardi said.

“My team gave me an opportunity to put us ahead in the ninth,” Harper said. “And man, I just missed that ball. So it’s kind of devastating for me, personally.”

Playoff race

The Phillies still left Citi Field with a series win, but every loss stings in September during a playoff race.

They begin a three-game series Monday at home against Baltimore, which has baseball’s worst record, before playing four with Pittsburgh.

“We’re going to have to take it game by game and really understand what we’re doing as a team,” Harper said. “Score runs, don’t take anyone for granted, pitch well, play well. Day by day, game by game, and go from there.”

The Phillies trail Atlanta by two games and have not had even a share of first place in September since 2011. To do so, the Phillies will need to take care of business against down teams while hoping Atlanta stumbles. The Braves play four games this week in Arizona, which has the worst record in the NL, and four in San Diego, which seems to be falling apart. The Phillies aren’t the only team with a light schedule.

“I think that’s a misconception about those teams that they’re not playing for anything,” Gibson said. “I’ve been on those teams that are battling against first-place teams or playoff teams and you want to play spoiler. They’re going to show up and they’re going to play hard. I don’t think you’re going to see any of us take them lightly because we know we have to take care of business, first and foremost. You can scoreboard watch all you want but if we don’t win, it doesn’t do us any good.”

Harper’s sprint

Girardi was asked before Sunday’s game what part of Harper’s game has impressed him the most this year.

He first mentioned Harper’s patience as he has walked 88 times this season, allowing teams to put him on base when they pitch around him instead of chasing bad pitches. Harper walked twice Sunday, including against a reliever who was brought in to face him in the seventh. Then, Girardi mentioned Harper’s defense, which has been mostly good in right field. Harper made a great sliding catch near the right-field line to end the eighth. And finally, he brought up Harper’s baserunning.

“I mean, sometimes we think he’s invincible,” Girardi said.

It didn’t take long to see what Girardi meant. Harper scored from first base on a first-inning double into shallow center by J.T. Realmuto, sprinting through third-base coach Dusty Wathan’s stop sign and catching the Mets off guard. The relay throw went to second, but Harper never stopped running. When the Mets noticed, it was too late.

“I talked to Dusty after the fact,” Harper said. “He said he was late on it and I felt like I was too far away from the bag to really stop. I got lucky enough that they overthrew the cut-off and I was able to score.”

Torreyes’ defense

Ronald Torreyes’ bat has cooled off significantly since his hot stretch earlier in the season, but his glove makes him almost a must-start when Gibson is on the mound. Torreyes made a pair of smooth plays at third base to end the third and fifth innings. Both plays would have led to runs had Torreyes not made the outs as he kept Gibson churning.

“Toe made a couple great plays down at third base,” Gibson said. “Our defense has been playing really well and I’m always appreciative of that. I like to get a lot of ground balls and keep them working.”