NEW YORK – The beginning of the Orioles’ final road trip of the season landed them at the one place they’ve actually played well this season: Yankee Stadium.

But as this Orioles team limps to the finish of the franchise’s worst season, it opened a 10-game stretch Friday against three teams positioned for the postseason.

The New York Yankees still had plenty to play for Friday night — the right to host the American League wild-card game.

And the Orioles offense was game, rallying from an early six-run deficit to come within one run on the heels of three homers. But each time the Orioles broke through with the bats, the pitching staff would give runs back in what ended as a 10-8 loss to a Yankees team clinging to the first AL wild-card spot.

“We talked about it before the game that there’s a lot of teams depending on us,” Orioles manager Buck Showalter said. “I didn’t have to tell them that. They knew that. Everybody was shaking their head in there. We’re going to make it as hard as we can on them. A lot of good things offensively but the walks hurt us. … A lot of young players did some good things. But it’s just the pitching. We’re just not quite, I don’t know if you want to say ‘mature enough.’ We do some good things, but we can’t [string] together a lot of sequences.”

The Orioles (44-109) matched their best run total this month, rallying with four runs in the eighth on two-run homers by Renato Núñez and DJ Stewart to cut the New York lead to 9-8. But the Orioles bullpen kept giving runs back, as it did in the bottom of the eighth, when Paul Fry yielded a critical insurance run on Aaron Judge’s RBI double.

Orioles right-hander Yefry Ramírez (1-7) couldn’t get out of the fourth inning — further clouding whether his future is as a starter or a long reliever — as he allowed six runs over 3 2/3 frames. Two of his three walks ended up scoring on home run balls.

The Orioles entered the night having won four of six games at Yankee Stadium this year, but they came into the Bronx having lost 11 of their previous 12 games on the road.

Ramírez allowed a pair of two run homers, a first-inning shot by Didi Gregorius and a fourth-inning blast by Aaron Hicks onto the short porch in right. That chased Ramírez from the game in a four-run fourth.

“I think I threw too many balls today, missing in the strike zone,” Ramírez said through interpreter Ramón Alarcón. “I think that’s what hurt me tonight and unfortunately I wasn’t able to [be] consistent in the strike zone tonight.”

Meanwhile, the Orioles were flummoxed by 38-year-old Yankees left-hander CC Sabathia (8-7), who held them to two runs over six innings.

eencina@baltsun.com

twitter.com/EddieInTheYard