The Yankees staved off the Tampa Bay Rays’ celebration for a few extra hours.

With no margin for error in their American League East chase, the Yankees began Tuesday’s split doubleheader in the Bronx with a 2-0 victory over the Rays behind eight stellar innings from Carlos Rodón.

But by the end of the night, it was the Rays who were reveling in a champagne-soaked visitors clubhouse at Yankee Stadium.

By dropping the second game of the doubleheader, 6-1, the Yankees were eliminated from AL East contention as the Rays clinched the division title.

“Obviously, we wanted to push [their celebration] off if we could,” Yankees manager Aaron Boone said. “Credit to them, they beat us today. … They put together a fantastic regular season to earn that.”

Rays starter Drew Rasmussen outdueled Max Fried in the nightcap, holding the Yankees without a hit until Heliot Ramos led off the seventh with a double.

The Yankees (90-67) will be the AL’s top wild-card team, meaning they will host a best-of-three Wild Card playoff series — likely against the archrival Boston Red Sox — next week.

While not the worst-case scenario, it’s a sobering outcome for a Yankees team that’s stayed afloat amid a season-long rash of injuries — namely to top sluggers Aaron Judge and Giancarlo Stanton — but that boasts a payroll roughly three times that of the unrelenting Rays (96-51).

That outcome became all but inevitable over the weekend when the Yankees fell six games behind the Rays with seven to play.

The Yankees thus entered this week’s four-game series knowing they would have to sweep Tampa Bay in order to keep their dwindling division dreams alive.

Rodón rose to the occasion in the first game, striking out eight over his season-high eight innings while limiting the Rays to three hits (all singles) and no walks.

His final strikeout was the 1,500th of his career. After his 96th and final pitch of the day, Rodón walked off the mound to a standing ovation.

With the win — the 100th of his career — Rodón improved to 7-3 with a 2.67 ERA in 16 starts. A two-run home run by Cody Bellinger against Rays starter Nick Martinez in the fourth inning was all the offense Rodón and the Yankees needed.

“Carlos is throwing the ball really well right now,” Boone said. “Today [was] as good as any time that he has.”

It was “potentially” the final start of the regular season for Rodón, according to Boone, who said the Yankees have not yet determined whether the left-hander might come out of the bullpen in the Wild Card round.

AL Cy Young Award favorite Cam Schlittler is a sure thing to start one of the Wild Card games, while Boone said last week that he expects Gerrit Cole to start one, too.

That would leave one more Wild Card game for either Rodón or Fried, who fell Tuesday night to 5-5 with a 2.80 ERA in 20 starts.

In six playoff starts with the Yankees, Rodón is 1-2 with a 6.92 ERA. But the left-hander has been a model of consistency since last August, having allowed three runs or fewer in 26 consecutive starts — a franchise record.

“Health-wise, I feel good,” said Rodón, who has been limited to 84.1 innings this year due to his recovery from offseason elbow surgery and a subsequent bout with elbow inflammation.

“Confidence is good. And as you know, [in the] playoffs, anything can happen. You get the best out of everybody. It’ll be fun.”

The Yankees couldn’t carry the momentum into Tuesday’s second game, however, as the right-handed Rasmussen — long a thorn in their side — hurled 6.2 innings of one-run ball with 11 strikeouts.

Despite going hitless through six innings, the Yankees kept it close until the seventh, when the Rays manufactured a three-run rally against Fried and reliever John Schreiber.

An RBI bunt single by Taylor Walls in front of Fried pushed across the Rays’ second run of the game, while a two-out, two-run single by Yandy Díaz against Schreiber allowed two inherited runners to score.

All of those runs were charged to Fried, who finished with a line of 6.2 innings, four runs, two walks and four strikeouts.

“You don’t want anyone to be celebrating at your stadium,” said Fried, who threw 97 pitches, his most since returning on Aug. 29 after a second IL stint for an elbow bone bruise.

“We’re still confident in the group that we have here.”

The Yankees have two more games against the Rays before they finish the regular season with a three-game series against the Baltimore Orioles in the Bronx over the weekend.

Boone said the Yankees’ rotation will remain on turn but that the Yankees will try to find chances to rest key players.

With their playoff seed now locked, the Yankees can turn their attention to the Wild Card round, where, barring the unforeseen, they will face Boston for a second consecutive postseason.

The Yankees won last year’s playoff series in three games before ultimately being eliminated in the ALDS.

Should the Yankees return to the ALDS this year, the Rays — who also clinched a first-round bye with Tuesday’s win — will be waiting for them there.

“It kind of sucks,” second baseman Jazz Chisholm Jr. said of falling short of the division crown. “That’s what we work on all season, but it’s not the end goal for us. That end goal is the World Series, so it doesn’t really affect us here.”