New York Yankees president Randy Levine (L) and general manager...

New York Yankees president Randy Levine (L) and general manager Brian Cashman look on prior to a game against the Baltimore Orioles at Yankee Stadium on Friday, Sep. 21, 2018 in the Bronx borough of New York City. Credit: Jim McIsaac

It’s not about the Red Sox, Brian Cashman said Friday. Not yet, and not if the Yankees want a real shot at making it deep enough into October for it to actually be about the Red Sox.

In the final games of the regular season, the Yankees will go all-out to earn home-field advantage for the wild-card game, Cashman said. They also will not consider pitching matchups against the Red Sox in the ALDS at the expense of throwing their best available starter in the wild-card round.

After Cashman spoke, the Yankees survived a bullpen implosion to beat the Orioles, 10-8. CC Sabathia (8-7) had a strong outing, allowing two earned runs in six innings (the 38-year-old, who earlier had said he might consider retirement after this year, said he plans to play in 2019).

Two-run home runs by Didi Gregorius (No. 27) and Aaron Hicks (No. 25) helped make up for shaky relief performances by Jonathan Loaisiga, A.J. Cole and David Robertson, who between them allowed three home runs and were charged with six runs in a total of one inning. The Yankees never trailed, but the Orioles (44-109) cut a 6-0 deficit to 6-4 and a 9-4 deficit to 9-8 before Aaron Judge’s two-out RBI double delivered an insurance run in the eighth and Dellin Betances pitched a scoreless ninth. The Yankees were outhit 13-10.

The Yankees have 249 homers in 153 games, which projects to 263.6 over 162 games. The 1997 Mariners own the major-league record with 264.

In the battle for the first wild card, the Yankees remained 1 1⁄2 games ahead of Oakland, which beat Minnesota, 7-6, on Khris Davis' walk-off home run in the 10th inning. The Yankees also have a tiebreaker advantage over the A’s.

The Yankees will need to do more than beat the Orioles to put them in good position in two weeks, and of that, Cashman is firmly aware. “Yes, yes and yes,” he said when asked if he’d be willing to throw Luis Severino or Masahiro Tanaka or J.A. Happ, or whoever is pitching the best, in the final days of the season if it means clinching home-field advantage in the wild-card game.

The season, he added, ends with trips to Tampa and Boston, “so you’d rather have the short trip back to New York and then you’re dreaming big things, and if you can find a way to get past that cage match, then you’ve got a quick trip thereafter. You’re just making life harder for yourselves if you have to do the alternative [play in Oakland]. We’re fighting for a wild card and hopefully a wild card with home field.”

Cashman twice used the expression “cage match’’ to describe the wild-card game, underlining the survival aspect over and over. And that means, he said, they can’t look at the heavyweight in Boston lining up to face the wild-card winner.

“We’re going to pick the best person to try to win that game,” he said. “We will pick whoever is best qualified at that time, regardless of that other series.”

This can translate to a number of variables. For instance, it could indicate that Happ’s longtime success against the Red Sox won’t preclude him from starting the wild-card game. If Severino, who has won 18 games and showed definitive signs of returning to form earlier this week, is the best option for that game, the Yankees won’t sit him just for the chance to have him face the Red Sox twice in the next series.

“Everything gets thrown out the door,” Cashman said. “It’s all hands on deck for that last game, to find a way to survive it.”

Said Aaron Boone, “We want to play here. We feel like we have a home-field advantage, but I also don’t want to get caught up in driving that home so much. We feel like we can beat anybody anyplace . . . If we go out and handle our business, if we take care of business, we’ll play that game at home, and that’s a priority of ours. We want to get that done because again, this is a special place for us, but we also want to be mindful that wherever that game [is], we will be ready for it.”

More Yankees headlines

Newsday LogoCritical LI Information You NeedDigital Access$1 for 5 months