Nick Castellanos ripped a winning two-out single off Tylor Megill that scored Trea Turner and sent the host Philadelphia Phillies to a dizzying 7-6 win over the New York Mets on Sunday and evened the NL Division Series at one game apiece.

Castellanos tossed his helmet and was mobbed by teammates on the infield as a game that seemed to slip away one inning earlier turned into one more comeback for the NL East champions.

Megill retired the first two batters of the ninth and walked Turner and Bryce Harper, who also homered and scored twice. Castellanos, who also homered, followed with perhaps the hit of his Phillies’ career.

“Unbelievable. Unbelievable,” Castellanos said. “If he blows a fastball by me so be it. I’d rather that than swing at something in the dirt. It was incredible but the series is even. Now we go to New York and there’s a lot of baseball left.”

He fell behind 0-2, took a ball in the dirt, then pulled a hanging slider into left and sparked the towel-waving crowd at Citizens Bank Park into a frenzy.

Mark Vientos tied the game 6-6 for the Mets in the top of the ninth with his second two-run home run of the game.

Game 3 is Tuesday in New York.

Saturday’s late result

DODGERS 7, PADRES 5 >> Shohei Ohtani hit a three-run homer in his postseason debut, Teoscar Hernández’s two-run single gave host Los Angeles its first lead in a playoff game in two years, and the Dodgers beat the San Diego Padres in their NL Division Series opener Saturday.

Manny Machado’s two-run homer off Dodgers starter Yoshinobu Yamamoto, also making his first playoff appearance, put Los Angeles in an early 3-0 hole.

Ohtani quickly bailed out the Dodgers with his two-out homer that tied it 3-all in the second inning. The Japanese superstar went deep with Hall of Fame pitcher Sandy Koufax looking on and fans chanting “MVP! MVP!” His shot traveled 372 feet to right field, the sellout crowd of 53,028 recording it all on their phones.

San Diego went ahead 5-3 before the Dodgers rallied with three runs in the fourth.

Tommy Edman scored on a wild pitch by reliever Adrian Morejon, who took the loss. Ohtani had a broken-bat single and later scored, along with Mookie Betts, on Hernández’s single off Jeremiah Estrada that put the Dodgers ahead 6-5.

It was their first lead in a postseason game since the seventh inning of Game 4 against the Padres in a 2022 NLDS. Los Angeles was swept by Arizona in a Division Series last year.

Trailing 7-5, the Padres had the potential tying runs on base with two outs in the ninth. Fernando Tatis Jr. singled off Blake Treinen before Jurickson Profar walked to bring up Machado, who struck out swinging. Treinen earned the save.

ROYALS, YANKEES SQUARE OFF IN GAME 2 >> Even with up to 24 video cameras, Major League Baseball didn’t have a precise picture showing whether Michael Massey’s glove slapped Jazz Chisholm Jr.’s left foot before it touched the corner of second base.

Lance Barrett’s initial safe call stood awarding the stolen base, and Alex Verdugo followed with a run-scoring single that gave the New York Yankees the lead for good in a 6-5 win over the Kansas City Royals in their AL Division Series opener on Saturday night.

The teams square off in Game 2 today at 4:38 p.m. at Yankee Stadium, with Cole Ragans going for the Royals and Carlos Rodon taking the hill for the Yankees.

“They just said there was nothing clear and convincing to overturn it, and if he had been called out, that call would have stood, too,” Royals manager Matt Quatraro said Sunday.

In the first postseason game with five lead changes, the score was 5-5 when Chisholm singled against Michael Lorenzen leading off the seventh. Chisholm took off for second as Anthony Volpe struck out and when Chisholm slid into second, his left foot hit the dirt inches short of the base, causing him to pop up.

Second baseman Michael Massey jumped to snag catcher Salvador Perez’s high throw and swiped down with his glove as Chisholm approached the base. The glove hit the front left side of Chisholm’s cleats as the back left of the shoe reached the base.

After consulting on the phone with Royals instant replay coordinator Bill Duplissea, who was in a room filled with monitors off the stadium tunnel, Quatraro signaled for a video review.

Chris Conroy, the umpire in the Rockefeller Center replay operations center, spent about two minutes checking an array of video in rectangles on a large screen inches in front of him. Informed of Conroy’s decision, Barrett announced to the Yankee Stadium crowd: “After review, the call on the field stands. The runner is safe.”

Watching from the Royals dugout, arms folded, Quatraro shook his head.

“After viewing all relevant angles, the replay official could not definitively determine that the fielder tagged the runner prior to the runner touching second base,” MLB said in a statement. “Additionally, the replay official could not definitively determine that the runner failed to maintain contact with the base as the fielder was applying the tag.”