In the top of the seventh inning May 22, Kansas City’s Jorge Soler stood on second base when Alcides Escobar hit a grounder up the middle that was fielded by Starlin Castro.

The Yankees were clinging to a one-run lead, and Castro made a one-hop throw to Chris Carter at first. Escobar was called safe, and Soler raced home, beating Carter’s throw to the plate to tie the game in The Bronx.

Adam Warren thought he had blown the lead.

“I thought he was safe,” Warren said. “He was called safe, and it was a bang-bang play. They only showed it on the scoreboard one time and even then, I thought they’d stick with the call on the field.”

But Brett Weber thought differently. Weber, the team’s coaching assistant/baseball operations, watches every play of every game, trying to find something that may not have been visible at first.

And on that play, he did.

“I just saw some space between the foot and the bag,” Weber said in Baltimore this week. “That one wasn’t too complicated. In that particular case, I felt we had higher than a 75 percent chance of winning. In that situation, I’ll challenge it 10 out of 10 [times].”

Weber was right, and the call was overturned, erasing a run off the board to preserve the lead in a game the Yankees won, 4-2.

“That was a game-changer,” Warren said. “It got us the third out. I went to the back and gave him a fist-bump.”

[mlbvideo id=”1417914383″ width=”640″ height=”360″ /]

Weber has earned more than a few of those in the four seasons since Major League Baseball instituted the replay review system. The Yankees have been successful on 74.7 percent of their challenges. Kansas City is next at 65 percent.

Weber said he doesn’t pay attention to the numbers, but manager Joe Girardi knows how important they are.

“You don’t ever want to feel like you lost a game because of replay,” the manager said. “With how crazy playoff races can be, it can come down to one game, one call. And he gives us an advantage.”

Take last season, when the Cardinals missed the postseason by one game and were right on just 52.7 percent of their challenges. The two NL wild-card teams, the Mets and Giants, ranked ahead of them (66 and 61 percent, respectively).

With the Yankees hoping to contend for the playoffs this year, they were tied with the Twins for the best challenge rate in the majors at 83.3 percent as of Thursday. The Yankees were successful on 12 of 14 attempts, Minnesota on 6 of 7.

And that is after the system was altered in an attempt to improve pace of play. Teams — and in the Yankees’ case, Weber — now have just 30 seconds to decide whether to challenge a play.

“It definitely speeds things up,’’ Weber said. “You have to make a decision quickly. Before, there really wasn’t a limit. It was discretionary and you could kind of get more time if you needed it. Now, there’s more pressure on everyone in my position.”

Bench coach Rob Thomson communicates with Weber and relays his message to Girardi.

“Usually, it’s almost instantaneous,’’ Thomson said of Weber’s decision. “A lot of times he knows the answer by the time he picks up the phone, and then he’ll double check. … I know when he gives us an answer, I’m banking on that.’’

The replay system is different in each park, with different angles depending on what networks are doing the game, so Weber familiarizes himself with all of them at the start of each series.

So, why are the Yankees so much better at this part of the game than anyone else?

“You’ve got to know the rules — and he knows the rules inside and out. He does his homework,’’ Thomson said of Weber. “He goes through all the replay [challenges] on a daily basis. All of them. He’s very thorough, and that allows him to know exactly what he’s looking for when something comes up and he’s able to do it right away.”

And it isn’t just the close plays that get Weber’s attention.

“I look at everything, whether you think it’s close or not,” Weber said. “In a play, a lot of things can happen that in real time may look differently.”

Which brings Weber to his favorite replay moment.

[mlbvideo id=”224748583″ width=”640″ height=”360″ /]

In the top of the 11th inning on July 3, 2015, Tampa Bay’s Evan Longoria hit what seemed to be a one-out double — again with Warren on the mound.

Weber, though, found something on a second look. Longoria had momentarily taken his foot off the bag and Jose Pirela held his tag. Longoria was called out, and the Yankees went on to win.

“I thought it was a double,” Warren said. “I had no idea why we were challenging.”

Girardi knows not to doubt Weber, whom he first met when the two worked out together when Girardi was a veteran player and Weber was drafted by the Yankees in the 14th round in 1998. Weber pitched in the Yankees’ system for three years, never rising above Single-A.

The 40-year-old, though, found a way to make an impact in the majors.

“I think he keeps getting better,” Girardi said. “I’ve believed in him from the beginning.”

Weber admitted he gets “a rush” out of challenging plays.

“I don’t look at is as competition,” Weber said. “I just don’t want to miss anything. Replay is there for a reason and the players deserve to have the right call made. There aren’t many times it comes into play, so when it happens, you have to be ready.”