PHILADELPHIA -- Bryce Harper delivered another clutch hit and then waited for a video review to celebrate.
Roman Quinn led off the inning with a single against Seth Lugo (1-2), and Andrew McCutchen followed with a single. After Rhys Hoskins struck out, Harper ripped an 0-2 pitch to right. Quinn slid headfirst ahead of Michael Conforto's throw. The Phillies gathered outside their dugout until a video review confirmed the safe call before jumping and air-fiving each other.
"It was definitely close," Harper said. "I was worried but once he said safe, I was very excited and very happy about it. One of the weirder walk-offs I've had, for sure."
The Phillies had a strong sense of urgency after being swept in a three-game series by the Orioles.
Harper called those losses "an embarrassment."
"This was an important win for us," manager Joe Girardi said.
J.T. Realmuto hit a go-ahead, three-run homer but Hector Neris (1-0) couldn't protect a one-run lead in the ninth. He allowed a single and walk before striking out Pete Alonso and Dominic Smith. Robinson Cano followed with an RBI single to tie it at 5.
Realmuto's drive in the fifth gave the Phillies their first lead, and the ball bounced off a cardboard cutout of a toddler in the left-field stands. Realmuto already has a career-best for homers in a month with seven and he's driven in 20 runs in just 15 games. The two-time All-Star catcher can become a free agent after the season.
Fans who gather outside the ballpark have been chanting "Sign J.T.!" throughout his at-bats this season. Harper has been vocal about his desire to see his teammate get a long-term contract. Harper has looked up to the suites where team executives sit and made a check-writing gesture after scoring on a few of Realmuto's homers.
Lockett gave up five runs and seven hits in six innings.
"I was glad to get through six and save the bullpen a little bit," Lockett said. "Couple mistakes. Not as sharp as I would like. But it was OK."
Phillies starter Spencer Howard lasted just 3 1/3 innings, allowing four runs -- three earned -- and seven hits. He left because of a blister on his finger but said he expects to make his next start.
Smith and Cano hit consecutive solo homers in the third to give the Mets a 4-2 lead. Smith barely cleared the fence in right but Cano's shot hit the scoreboard on the facing of the second deck.
Alec Bohm and Quinn lined consecutive RBI singles in the second to tie it at 2-2. It was the first career RBI for Bohm, who was called up Thursday.
Mets manager Luis Rojas said he doesn't think deGrom has a long-term injury and the hard-throwing righty anticipates making his next start. He even considered not missing this one.
"I debated on trying to go out there, and I think talking over it, it was, `Let's make this hopefully a one-start thing and not really aggravate something, or feeling this, change my arm slot and hurt something else," deGrom said. "These were all discussions we had. So hopefully it's a one start thing, but it's basically day by day right now. I love going out there and pitching and competing. And when you're not able to, it really does frustrate you."
Mets: Optioned RHP Drew Smith to the team's alternate site.
Phillies: Called up LHP JoJo Romero and optioned LHP Austin Davis.
Mets: INF/OF Jeff McNeil wasn't in the starting lineup after crashing into a wall and being carted off the field Thursday. McNeil said he's feeling better and tests revealed only a bone bruise. ... Cano (left groin) was activated from the injury list and started at designated hitter. ... SS Amed Rosario was back in the lineup after a stomach bug kept him out three games.
Phillies: INF/OF Scott Kingery said he's been bothered by back and shoulder issues since returning from a bout with coronavirus. Kingery was out of the lineup for the third straight game and is hitting just .100 (4 for 40).
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Rays eye magic number, face sinking Mets
With one more win, the Tampa Bay Rays can celebrate a division title 10 years in the making.
Indians targeting playoff berth against White Sox
The Cleveland Indians look to punch their ticket to the postseason for the fourth time in five seasons on Tuesday when they continue their four-game series against the visiting Chicago White Sox.
Fantasy baseball: Jose Ramirez is a top-10 talent
Eric Karabell talks about why Cleveland's third baseman should be a 2021 first-rounder and recaps Tuesday's games, which included another loss due to lack support for Jacob deGrom.
'This isn't fun': How everyone in baseball has navigated a very different season
The game has gone on. It's good that it has. But it has felt different, sounded different, looked different. As Indians manager Terry Francona put it: "Everything is hard now."
Can the best Dodgers team yet end L.A.'s World Series drought?
As good as the mighty Dodgers are, even they are subject to the randomness that makes the MLB postseason so exciting.
Passan: Inside a final week like MLB has never seen before
The Marlins are looking like a playoff team? Jose Ramirez for AL MVP? Jeff Passan has 20 questions -- and answers -- about baseball's frantic finish.