New York Yankees players mob Mark Teixeira at home plate...

New York Yankees players mob Mark Teixeira at home plate after his walk-off grand slam against the Boston Red Sox to win an MLB baseball game at Yankee Stadium on Wednesday, Sept. 28, 2016. Credit: Kathleen Malone-Van Dyke

By virtue of a Blue Jays loss to the Orioles in Toronto, the Red Sox clinched the AL East while the Yankees were batting in the bottom of the ninth inning down three runs at Yankee Stadium Wednesday night.

Boston’s players were poised to celebrate after the last out, ready to leap over the dugout railing and mob each other on a dogpile on the infield. On the Yankees’ infield.

Only 25¢ for 5 months

Unlimited Digital Access. Cancel anytime.

Already a subscriber?

By virtue of a Blue Jays loss to the Orioles in Toronto, the Red Sox clinched the AL East while the Yankees were batting in the bottom of the ninth inning down three runs at Yankee Stadium Wednesday night.

Boston’s players were poised to celebrate after the last out, ready to leap over the dugout railing and mob each other on a dogpile on the infield. On the Yankees’ infield.

But the Yankees, who had one infield single coming into the ninth, denied Boston the chance to party like it was 2004. Instead, it was the Yankees who were celebrating at home plate after the retiring Mark Teixeira hit a two-out, walk-off grand slam to right-center for an incredible 5-3 victory.

In what will probably end up being their Game 7, their World Series, the Yankees scored five runs in the ninth to win a game for the second time in three days. The Yankees not only kept the Red Sox from turning Yankee Stadium into their own mosh pit, but staved off playoff elimination for at least one more day with their third straight victory.

“It’s an unbelievable moment,” Joe Girardi said. “It’s a great moment for him and a great moment for us.”

The Yankees have about the same chance of making the playoffs as I do of being Angelina Jolie’s next husband. Don’t bet the farm on either.

With four games to go, the Yankees will be eliminated if they lose once more or the Orioles win once more. Baltimore visits the Bronx starting on Friday. But even if the Yankees won out and the Orioles lost out, the Yankees still would have to jump over Houston, Seattle and Detroit.

“We knew our odds were long for a while,” Teixeira said. “We’re not doing the math in our head.”

At least the Yankees’ amazing comeback from a 3-0 deficit will be a story told around the Teixeira household until Mark is rocking his great-grandchildren to sleep.

It was the first time the Red Sox clinched a regular-season crown while playing the Yankees franchise since 1904. But they had to celebrate in private.

Moments after Teixeira enjoyed a Gatorade bath at home plate, the Red Sox doused each other with champagne in the losing clubhouse.

That has to be a first in baseball history.

“You never want to see a team celebrate on your home field — or celebrate at all,” Teixeira said. “That’s as good as it gets right there. I guess if you hit one to win the World Series, that might be just as much fun, but with the kind of season we’ve had — we’ve been fighting all year — to come back from three runs down against one of the best closers in baseball, it just shows a lot about our team.”

The Yankees had one hit going into the ninth, a dribbler by Brett Gardner in the fourth. Craig Kimbrel started the inning and couldn’t find the plate.

Teixeira hit the first regular-season walk-off homer of his 14-year career off Joe Kelly. Teixeira’s only other game-ending homer came in the 11th inning of Game 2 of the 2009 ALDS against the Twins.

It was the 409th home run of Teixeira’s career. Minutes after the game, he had the ball in his locker. It was sticky from the Gatorade. He didn’t care.

Teixeira would like to hit a few more, but he said he’s OK if that ends up being his last one.

“You don’t want like a wall-scraper in an 8-0 game to be your last one,” Teixeira said. “You want a walk-off grand slam against the Red Sox.”