By Sam Bush

The Phillies were hoping for a sweep of the Mets but had to settle for winning two out of three in New York.

And, as a result, the Phils are two games behind the Braves in NL East and 3 1/2 behind the Cards for the second wild card playoff spot.

And there are just 13 games left, starting tonight when the Phils take on the woeful Orioles at CBP.

Jeff McNeil hit a tiebreaking homer leading off the seventh inning, and the Mets beat the Phils last night 3-2.

”Anytime you’re able to come in here and win two out of three, it’s big for us, especially in the spot that we’re in,” said Bryce Harper, who scored the Phillies’ first run and drove in their second before ending the game with a deep fly out to left.

McNeil’s homer off Phillies starter Kyle Gibson was his first since Aug. 1 and gave the Mets their first lead since squandering a 3-2 advantage in the eighth inning of Tuesday’s 7-6, 11-inning loss to the Cardinals.

Aaron Loup (6-0), the fifth of six Mets pitchers, walked Harper to load the bases in the sixth before getting J.T. Realmuto to hit into a fielder’s choice. He then worked around a two-hit single by Ronald Torreyes in the seventh to lower his ERA to 1.00 in 51 innings this season.

Loup acknowledged he’d like to finish with an ERA below 1.00. The lowest ERA by a Mets reliever is a 1.47 mark produced by Tug McGraw in 1969 and Jesse Orosco in 1983.

”It’d be a great accomplishment,” Loup said. ”I think I’ve had a great year. To finish under 1.00 would be icing on the cake, I guess you could say.”

Edwin Diaz plunked Freddy Galvis with one out in the ninth before striking out Jean Segura and retiring Harper to earn his 30th save.

The Phillies stranded 10 runners.

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

Harper went 0 for 2 as his 14-game hitting streak was snapped, but he still helped the Phillies jump out to a 2-0 lead against Hill. With two outs in the first. Harper walked and ran through a stop sign by third base coach Dusty Wathan to score on a bloop double by J.T. Realmuto. In the fifth, Freddy Galvis singled, went to third on Jean Segura’s double and scored on Harper’s sacrifice fly.

McNeil sparked the Mets’ rally in the fifth with a leadoff single. Tomas Nido followed with a double and both runners raced home on a pinch-hit, two-run double by Dominic Smith, who is 4 for 11 with four RBIs as a pinch-hitter this month.

”It’s a good night for Jeff,” Mets manager Luis Rojas said. ”He can get hot right now and we definitely need that.”

Gibson (10-8), who pitched beyond the sixth for the third time in nine starts with the Phillies, allowed three runs on seven hits and one walk with nine strikeouts in 6 2/3 innings.

Hill remained winless in 11 appearances (10 starts) with the Mets after allowing two runs on six hits and one walk with seven strikeouts in 4 2/3 innings.