After 161 games, the New York Yankees still need one more victory.

No simple task against Brandon Lowe and a 100-win Tampa Bay team that’s a consistent thorn in their side.

Lowe hit three home runs and the Rays rolled to a 12-2 blowout of New York that prevented the Yankees from clinching a playoff spot Saturday. Instead, they fell into a tie with Boston atop the AL wild-card standings.

Also Read | MLB: Boston Red Sox inch closer to sealing wild-card berth after win over Washington Nationals

With a chance to pitch his team into the postseason, New York starter Jordan Montgomery instead was rocked for a career-worst seven earned runs in 2 2/3 innings. He gave up a pair of three-run homers to Lowe, who also went deep in the seventh against Michael King.

Also Read | MLB Explainer: How the wild card tiebreakers work

Even with the embarrassing defeat before a booing home crowd of 41,648, the streaky Yankees (91-70) can still punch their AL wild-card ticket Sunday with a victory over Tampa Bay in the scheduled regular-season finale.

Another loss, and it gets dicey.

Also Read | MLB: Vladimir Guerrero Jr. ties homer record in Blue Jays’ 10-1 win over Orioles

“We’ve got to win. It’s as simple as that,” veteran outfielder Brett Gardner said. “Here we are going into Game 162 not knowing what the future is.

“It’s not ideal. But it’s nice knowing that we still have a chance,” he added. “The way the season has gone, it kind of makes sense that it would come down to the very last day. Seems about right.”

New York is assured at least a tiebreaker game next week that could put the team in the playoffs for the fifth straight season. But after dropping the first two games of this series, the Yankees no longer control their own destiny to host the wild-card game. Now they need a Boston loss to do so.

The Red Sox beat Washington 5-3 to draw even with the Yankees. Toronto and Seattle are one game behind them.

“Just a bad day for us and we’ve got to get over it quickly,” Yankees manager Aaron Boone said.

Lowe batted in the eighth with an opportunity to match the major league record of four home runs in a game. He evaded a 93 mph fastball from Joely Rodríguez that was way inside, then grounded out to first base.

Lowe and Mike Zunino homered back-to-back off Montgomery (6-7) in the third to make it 7-1. Austin Meadows added a three-run shot in the seventh as the AL East champion Rays (100-61) reached 100 wins for the first time in team history.

“Very big. Pretty special,” Tampa Bay manager Kevin Cash said. “So proud of the guys, happy for them — 100 sounds better than 99.”

The defending American League champions, who already wrapped up home-field advantage throughout the AL playoffs, had never before been 39 games over .500.

Zunino, Randy Arozarena and Wander Franco had three hits apiece for the small-budget Rays, who outhit New York 19-4 and are undoubtedly determined to make things difficult on their big-spending rivals all weekend.

Arozarena reached base five times, and Luis Patino (5-3) worked two hitless innings for the win.

Montgomery’s shortest outing this season marked an untimely end to a strong stretch.

The left-hander had permitted no more than one run in three straight starts and nine of his past 11, going 3-1 with a 2.26 ERA during that span. He was 1-0 with a 1.65 ERA and 22 strikeouts over 16 1/3 innings in his past three outings and had allowed three earned runs or fewer in 15 of his last 16 starts since June 20.

“Nobody’s perfect. They’re going to happen,” he said. “Just got to be better next time.”

Lowe has gone deep in his past three games, and his career-high seven RBIs gave him 99 this season. He increased his career-best total to a team-leading 39 homers with his first three-homer game in the majors.

“I’d love to get to 40 and 100,” Lowe said.

“It was cool. The first one was probably my favorite one of the day,” he added. “The other two were just kind of icing on the cake.”

It was his sixth career multihomer game and fourth this year.

“What a day. What a season he’s put together. Today was pretty special,” Cash said.

Anthony Rizzo homered for the Yankees, and Gio Urshela had an RBI triple.

TRAINER’S ROOM

Rays: With Cash looking to rest 1B Ji-Man Choi and INF Joey Wendle, catcher Francisco Mejía made his first career start at first base.

Yankees: 3B DJ LeMahieu missed his second consecutive game with a sports hernia that will require offseason surgery, but the two-time batting champion will attempt to play through the injury in October. He received a cortisone injection Friday and the team hopes he can return to the lineup Sunday … 1B Luke Voit probably will be sidelined for at least a couple of weeks with left knee inflammation. Voit, placed on the 10-day injured list Thursday, could potentially return later in October if the Yankees advance deep enough in the postseason, Boone said.

WHERE’S THE HUSTLE?

Montgomery was booed loudly and so was Gleyber Torres, who didn’t run hard to first and was thrown out after he swung and missed at strike three on a pitch that went all the way to the backstop in the seventh.

“First off, you’ve got to run,” Boone said. “He felt bad about it.”

HOME AWAY FROM HOME

Tampa Bay improved to 7-2 this season and 12-3 over the last two years at Yankee Stadium, where all other visiting teams are 32-64.

UP NEXT

Jameson Taillon (8-6, 4.40 ERA) is scheduled to start Sunday for the Yankees. He’s been bothered lately by a right ankle tendon injury, but tested it Friday in a successful bullpen. RHP Michael Wacha (3-5, 5.26) goes for Tampa Bay.