NEW YORK — If the trash cans in the clubhouse Tuesday night were any indication, the Orioles surely did enjoy their playoff clinching celebration.

Usually, that results in the stereotypical “hangover” game. The team limps through nine innings as it bides time until the playoffs begin.

Well, the Orioles must have done a phenomenal job hydrating.

On Wednesday, they showed no signs of exhaustion from the long hours of festivities. Instead, it was the Yankees, still needing one win to take the American League East, who appeared sluggish for most of the game. They were down by as many as seven runs but came back within two in the bottom of the ninth thanks to Aaron Judge’s three-run homer off Matt Bowman.

The Baltimore Banner thanks its sponsors. Become one.

The Orioles still won 9-7, preventing the Yankees from making a late comeback.

“Opposite of sluggish,” Orioles manager Brandon Hyde said. “Right away just really good at-bats from the first inning. Nice to score a few runs there early.”

The Orioles’ magic number to clinch the top wild card seed — and therefore home-field advantage for the best-of-three series — drops to one. They can secure that Thursday with a win or a Detroit loss.

And, technically speaking, Baltimore isn’t out of the division race, though taking that crown would require the Orioles to win their last four games and the Yankees to lose their last four. They have one more against each other Thursday, then the Orioles head to Minnesota and the Yankees host the Pirates.

Every player in the lineup got at least one hit as the Orioles took advantage of the Yankees’ last-minute switch in starting pitchers. Nestor Cortes was supposed to start, but he was placed on the injured list with a left elbow flexor strain. Marcus Stroman started instead, and the Orioles had a field day.

The Baltimore Banner thanks its sponsors. Become one.

Gunnar Henderson, who had three hits, scores a fourth-inning run. (Luke Hales/Getty Images)

From Colton Cowser, the photographer of Tuesday’s clinch celebration, to Gunnar Henderson, who took more than his fair share of sips from the homer hydration station, to Anthony Santander, who made it his mission to pour beer on anyone he deemed “too dry,” the Orioles had 10 hits off Stroman and 17 total. Henderson and Cedric Mullins had three hits, while Jordan Westburg, James McCann, Santander and Cowser each had two.

“We had a lot of singles; we had a lot of clutch hits,” Hyde said. “Kept the line moving. I thought our at-bats all night were really good. You can never score enough here, as we almost saw. It was a great night for us offensively.”

Zach Eflin wasn’t his sharpest, allowing three runs in 4 2/3 innings and a career-high five walks, the shirt full of beers he was carrying around Tuesday night perhaps a factor. Even if it wasn’t, the offense’s productivity ensured that his off start wasn’t of concern.

“Honestly just kind of stuck in my mechanics today, felt like I was fighting an uphill battle of throwing the ball over the plate,” Eflin said. “But, made pitches when I needed to and offense was there. It was a great win, offense had my back, defense made some great plays, but command was definitely a little frustrating.”

This was Eflin’s shortest start in a stellar beginning to his tenure with the Orioles. Prior to Wednesday, he had a 2.31 ERA with just six walks in eight starts. Eflin, who is under contract for next season, is expected to start Game 2 of the playoffs.

The Baltimore Banner thanks its sponsors. Become one.

“Obviously super excited to be a part of these guys and blessed to be here,” Eflin said. “It’s such a great group of guys, and I’m looking forward to going on a deep October run.”

Zach Eflin walked five in 4 2/3 innings after a series of effective starts for the Orioles. (Luke Hales/Getty Images)