NEW YORK — Yankees reliever Jonathan Holder created a mess when he asked catcher Brian McCann to repeat the signs in the fifth inning.

Eventually, the umpires sorted it out.

The crew pulled a run off the board by overturning a balk call against Holder, and then Tyler Austin homered in the ninth to lift New York over the Tampa Bay Rays 5-4 on Thursday night.

Holder had his foot on the rubber when he motioned with his glove for McCann to repeat the signs. First base umpire Jordan Baker called it a balk, allowing Logan Forsythe to score from third to momentarily make it 4-4.

McCann and Holder argued immediately and were joined on the field by Yankees manager Joe Girardi.

Crew chief Mike Everitt and the umpires conferred and changed the decision, sending Forsythe back to third and bringing Rays manager Kevin Cash out for an explanation.

“Basically three of the umpires felt that it was not a balk, Mike himself included, but when another umpire calls a balk he has to kind of announce it,” Cash said. “I have not seen the play, it was kind of a little unique.”

The decision cost Tampa Bay innings later when Austin ended it with his homer.

“Tough loss man,” Cash said. “I felt we did a lot of things right.”

Austin homered off Erasmo Ramirez (7-11) on a 3-2 pitch for his third homer since being called up Aug. 13.

“That was a huge team win for us,” Austin said, “and a special moment.”

McCann hit two homers for the Yankees.

The pesky Rays erased three Yankees leads in the first six innings behind two homers each from Kevin Kiermaier and Steven Souza. This was the first game this season in which three players had multiple homers, per the Elias Sports Bureau.

The Rays trailed three times during a 7-6 win over Baltimore on Wednesday, too.

Kiermaier homered twice in the first three innings, setting a career high with his 11th homer in the third. He’s hit safely in a career-best 12 straight games, the longest streak by a Ray this season.

Souza had his third multihomer game of the season, and second at Yankee Stadium. After hitting a solo homer to right-center in the second, he crushed a ball 430 feet off the glass sports bar beyond center field in the sixth for his 15th homer.

The streaky Souza had been in a 5-for-40 slump without a home run.

“I think I got a little bit to go as far as not trying to overthink things,” Souza said. “… I’ve done a really poor job of sticking to my game plan.”

Alex Cobb made his second start since having Tommy John surgery in 2015. He allowed four runs — three earned — over six innings. He gave up two homers and threw 89 pitches.

Tommy Layne (2-1) entered and struck out pinch-hitter Logan Morrison to end the ninth.

WELCOME ABOARD

New hitting coach Chad Mottola joined the Rays after being promoted from minor league hitting coordinator when Tampa Bay fired Derek Shelton on Tuesday.

SHORT SHUFFLE

The Rays signed veteran shortstop Alexei Ramirez before the game, and Cash said the team will shuffle him, Nick Franklin and Brad Miller at short, with Franklin getting the most reps.

Miller left after being hit by a pitch in the right elbow in the first. He has right elbow soreness, and X-rays were negative.

Ramirez filled in and went 1 for 3.

TRAINING ROOM

Rays: SS Matt Duffy will have surgery Friday on his left heel. Dr. Bob Anderson, team orthopedist for the NFL’s Carolina Panthers, will perform the operation. … RHP Chase Whitley is expected to return following Tommy John surgery in one of the next three games. Whitley pitched for the Yankees in 2014 and ’15 but was placed on waivers and claimed by Tampa Bay last November while recovering from the surgery.

UP NEXT

Rays: Rookie LHP Blake Snell (5-7, 3.39) starts vs. New York on Friday night. He struck out seven over six innings of one-run ball in a win against Toronto last time out and has a 2.61 ERA in two starts against New York this season.

Yankees: RHP Michael Pineda (6-11, 5.10) pitches against Tampa Bay. Pineda is 0-1 with a 7.04 ERA over his past three starts.