NEW YORK (AP) -- Looking for every extra edge in a playoff chase, the Philadelphia Phillies tried most everything - stealing and bunting, plus plenty of pinch-hitters and pitchers.
On and on they went, mixing and matching against the New York Mets for so long the teams actually began to run out of baseballs.
In the end, the Phillies had just enough.
''It wasn't the prettiest win by any stretch,'' manager Gabe Kapler said.
The game took 4 hours, 29 minutes - a minute short of matching the longest nine-inning game in NL history. When it was over, Philadelphia had closed within two games of Chicago for the second wild-card spot. The Mets stayed four back of the Cubs, who lost Milwaukee 8-5.
With both managers maneuvering, the clubs combined to use 39 players, including eight pitchers apiece. Hector Neris escaped a two-on, one-out jam in the ninth.
''We have to try to win games,'' Kapler said. ''We have to try to win the inning.''
Injured star Bryce Harper drew a bases-loaded walk as a pinch-hitter, capping a three-run seventh inning to put the Phillies ahead 10-6. That came shortly after a sensational catch by right fielder Sean Rodriguez preserved a slim lead.
Wilson Ramos and Robinson Cano hit back-to-back homers in the first inning for a 3-0 New York edge. But Noah Syndergaard couldn't hold it and the bullpen got battered yet again as the Mets missed a chance to move up in the postseason race.
''It stings, it stings,'' Mets manager Mickey Callaway said. ''We're still going to be the same amount of games back. We've got one less game to make that up. But we can do it.''
It was the longest nine-inning game in Mets' history, topping a 4:14 matchup with Washington last Sept. 23. The Phillies tied for the longest nine-inning NL game at 4:30 on July 6, 2018, against the Pittsburgh.
The Red Sox and Yankees set the major league record of 4:45 in 2006.
By the late innings, extra balls were needed. Usually, 16 dozen are rubbed up for games at Citi Field - that's more than at most parks and usually ample by a lot. But the teams ran through those, and required an extra two dozen to finish.
Phillies starter Vince Velasquez blamed himself for the slow proceedings. He allowed four runs, six hits and four walks in 4 1/3 innings.
''I take full responsibility on that end,'' he said.
Pinch-hitter Phil Gosselin blooped an RBI single that gave the Phillies a 5-4 lead in the sixth and Franco followed with a two-run homer. Franco later doubled and had seven homers and 18 RBIs in 15 games against the Mets this year.
The Mets clawed back for two runs in the bottom of the sixth to make it 7-6 and had the tying run in scoring position, but Rodriguez charged hard into the tight foul space, banged hard into the wall and caught a fly by J.D. Davis to end the inning. Rodriguez's teammates waited outside the dugout to greet him, and several players came off the bench to join in.
Kingery hit a two-run homer in the seventh and Harper walked to make it a four-run lead.
Ranger Suarez (5-1) got two outs for the win and Neris closed for his 24th save in 30 chances. Paul Sewald (0-1) took the loss.
Harper set a career high with 101 RBIs, one more than he had last year with Washington. He didn't start for the second straight day after being hit in the right hand by a pitch Friday night. Kapler said he was figuring on Harper being able to play Monday night, but needed to check with him first.
Rookie Pete Alonso has reached base in 33 straight games, tying the Mets' single-season record shared by Darryl Strawberry (1987) and Jose Reyes (2008).
Mets: Jeff McNeil and Brandon Nimmo both got checked by a trainer after fouling balls off themselves, but they stayed in the game.
Phillies: RHP Aaron Nola (12-4, 3.63 ERA) faces RHP Mike Foltynewicz (5-5, 5.28) and the NL East-leading Braves. Nola is 3-0 against Atlanta this year and 10-3 lifetime.
Mets: RHP Jacob deGrom (8-8, 2.76) starts as the Mets host playoff-contending Arizona and RHP Merrill Kelly (10-13, 4.69) to begin a four-game series. The Diamondbacks are 1 1/2 games behind the Cubs.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports