MLB

Ronald Torreyes the hero as Yankees walk off in 10th

Manager Joe Girardi said before Friday’s game that he thought his young Yankees were ready to rebound after their worst stretch of the season.

Many hours later, they proved him right — thanks to Ronald Torreyes and Masahiro Tanaka.

On the verge of losing for the ninth time in 10 games, the Yankees instead tied the game with a Brett Gardner homer in the ninth and then won it in the 10th on Torreyes’ two-out single to center that knocked in Gary Sanchez from third.

The 2-1 victory meant Tanaka’s best outing in nearly two months wasn’t squandered — and it kept the Yankees percentage points ahead of the Red Sox for first place in the AL East.

“We really needed this one,” Girardi said after it was over and Tanaka had pitched eight scoreless innings. “We’ve been scuffling … and when you get a performance where [Tanaka] shuts down a team like that, you need to win that game.”

Sanchez started the winning rally with a one-out hit and moved to third on Didi Gregorius’ single to right. After Chris Carter, who was released following the game, struck out for the third time of the night, Torreyes came through.

And no one seemed surprised that the utility infielder delivered perhaps the biggest hit of the season.

“There’s nobody else I’d want up in that situation,” said Aaron Judge, who insisted he was serious, despite the other heavy hitters in the lineup. “The way [Torreyes] barrels up everything and puts the ball in play, that’s who you want up there.”

Before the Yankees won it in the bottom of the 10th, Chasen Shreve got Elvis Andrus to pop to second on a 3-2 pitch with the bases loaded to end a threat and keep the game tied, 1-1.

Aroldis Chapman gave up an unearned run in the ninth on a passed ball with Andrus at third, but Gardner erased that deficit with a one-out homer off Texas closer Matt Bush.

The ending overshadowed an epic matchup between Tanaka and Yu Darvish, who met for the first time in the majors.

Neither gave up a run, and Tanaka allowed just three hits and two walks while striking out nine. It was his best outing since a complete game shutout in Boston on April 27.

Darvish went seven innings and allowed two hits — no walks — and fanned 10.

Brett Gardner hits a game-tying home run in the bottom of the ninth inning Friday in a game the Yankees went on to win 2-1 in the 10th.Getty Images

Tanaka, who has been at the center of the rotation’s woes, was superb.

“My stuff was there tonight, and I had really good defense,” Tanaka said through an interpreter. He added that though he was looking forward to facing Darvish, it didn’t impact him once he took the mound.

Having giving up seven homers over his previous three starts and pitching to a 7.71 ERA in his past nine games, Tanaka was in fine form against the Rangers.

At one point, after the start of the game was delayed 1 hour, 42 minutes by the threat of rain, Tanaka retired 16 straight — while Darvish had a stretch in which he set down 13 in a row.

Tanaka found himself in a jam in the third after an infield single by Jonathan Lucroy and a walk to Mike Napoli. But Tanaka recovered to strike out Joey Gallo and then got Shin-Soo Choo to ground into a double play, which was started by Torreyes. He made a diving stop at third, where he was filling in for the injured Chase Headley.

Darvish left after just 88 pitches, replaced by Tanner Scheppers.

While Tanaka, 28, and Darvish, 30, had never faced off in the majors, they had pitched against each other four times in Japan.

Neither could have been much better on Friday, but both had exited before the game was decided.

Torreyes made sure he ended it.

After hitting a hard comebacker to Bush in the ninth, Torreyes did even better an inning later.

“I was just looking to hit something hard,” Torreyes said before praising Tanaka. “Without Tanaka, we wouldn’t have had a chance.”