Yankees starter Nestor Cortes stands on the mound while umpires discuss...

Yankees starter Nestor Cortes stands on the mound while umpires discuss a fly ball hit by the Rays' Yandy Díaz that hit the catwalk in centerfield during the first inning of a game Thursday in St. Petersburg, Fla. Credit: AP/Steve Nesius

ST. PETERSBURG, Fla. — This — and only this — is what the Yankees currently have going for them:

The Orioles over the last month, while not nearly as bad as their closest pursuer in the American League East, have played .500 baseball. And, in the last week, they have been even worse than the Yankees — no small feat.

And so, despite losing two of three to the Rays, a result sealed with a 5-4 loss Thursday night at Tropicana Field, the still very much skidding Yankees arrive in Baltimore Friday for their first-place showdown not the eight or nine games down they probably should be.

Instead, the Yankees, 6-17 in their last 23 games since June 15, are just two games behind the Orioles, who are 12-12 since June 15 and losers in five of their last seven games, including coming off a three-game sweep at the hands of the mediocre Cubs.

“Nobody likes losing,” said Aaron Judge, who went 0-for-4 with a walk, including fouling out in the ninth with runners at first and second and one out Thursday. “Nobody’s happy about it, but we’re not feeling sorry for ourselves. Nobody else is. We just have to keep showing up and doing our thing. [We’re] a couple games out of first place, we’re going to play a first-place team right now.”

The Yankees (56-39), who send Gerrit Cole to the mound Friday night, are 0-7-1 in their last eight series.

“We’ve gotta get going in the right direction, that’s where the focus is,” Aaron Boone said of his team being a mere two games out of first, even as poorly as it has played for nearly a month. “It’s about us playing well. Can’t worry about that stuff too much. If we play well, we’re in control of things.”

After a two-out RBI single by rookie Ben Rice in the ninth brought the Yankees within 5-4 and put runners on the corners against rickety Rays closer Pete Fairbanks, Gleyber Torres popped out to second baseman Jose Caballero, who sprinted into short left-center, to end it.

That made the Yankees 1-for-9 with runners in scoring position with 10 stranded.

That kind of offensive showing has been a commonality in this stretch of generally rancid baseball for the Yankees, as is this, maybe even more so: their starters putting them in an early deficit.

That was the case Thursday when Nestor Cortes allowed a two-run homer to Randy Arozarena and, after the Yankees tied it 2-2 in the top of the third, gave up three runs in the third that gave the Rays (46-47) a 5-2 lead.

“Obviously, these guys [the Rays], we play them a lot, faced them a lot during the years,” said Cortes, who entering the night was 0-4 with a 5.63 ERA in nine road starts compared to 4-3 with a 1.81 ERA in 10 starts at home. “They know my game plan, know what I’m trying to do. I just have to do a better job of throwing wrinkles in there and they’re off my stuff.”

There was theater late, besides that from the ninth inning.

Rice’s sacrifice fly in the fifth made it 5-3 and the Yankees appeared poised to inch closer in the eighth against lefthander Colin Poche, putting two on with one out. Boone sent up the righty-hitting Jose Trevino to pinch hit for the lefthanded hitting Austin Wells, who homered in the second inning.

Trevino got ahead 3-and-0 before taking a called strike that looked high. After Trevino was called out on strikes, the Yankees dugout screamed their displeasure and pitching coach Matt Blake was ejected by plate umpire Edwin Moscoso. Blake has been ejected four times in his tenure as pitching coach, twice by Moscoso. Righthander Manuel Rodriguez came on and walked Anthony Volpe to load the bases, but Trent Grisham flied softly to left.

“Obviously a big call in that spot,” Boone said. “Thought Trevi put [up] a good at-bat. Unfortunate.”

Said Trevino: “Frustrating, but probably should have hit the 3-1 [pitch] I guess.”

Frustrating too, is his club’s inability to get on track.

“It’s been tough for us a little bit, but you just have to keep going, keep grinding,” Trevino said. “Nobody’s going to feel sorry for us. If anything, people want to see this. We’re the Yankees. If we win, we should have won. If we lose, they like that. I think we’ll get back to where we were and play with that chip on our shoulder . . . This thing will turn around for us, we’ve just got to keep going.”

More Yankees headlines

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 5 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME ONLINE