Close wins have been hard to come by for the Yankees this season, but they got a badly needed close victory Thursday night.

Brett Gardner homered to rightfield in the 11th inning to give the Yankees a 6-5 win over Tampa Bay. The win improved them to 54-46, extended their lead over Kansas City for the top wild-card spot to one game and put 2 ½ games between them and the Rays. They also moved within a half-game of AL East-leading Boston.

This all owes very little to the Yankees’ performance in one-run games (10-19). Before Thursday night, they had lost 14 of their last 16 one-run games. Heading into Thursday, only the Phillies had a worse winning percentage in games decided by a run.

Joe Girardi chalked up Thursday night’s win to some good fortune (a fielding miscommunication by the Rays allowed the tying run to score with two outs in the ninth), timely hitting and a strong performance by the bullpen.

“We were down to our last out, we end up catching a break and then Gardy takes advantage, and the bullpen did a tremendous job,” he said.

The Yankees came into Thursday’s action with a plus-110 run differential, which was fourth highest in baseball behind the Dodgers, Astros and Diamondbacks. Their overall winning percentage is eighth, with the lackluster performance in close games causing the discrepancy.

advertisement | advertise on newsday

The good news for the Yankees is that run differential tends to be a better predictor of future winning percentage than past winning percentage, a phenomenon observed by Bill James in his Baseball Abstracts.

A related finding is that performance in one-run games tends to be inconsistent, as a team’s record here tends to regress to .500 in the long run.

Last year, for example, on July 8 (the Friday before the All-Star break), the five teams with the best record in one-run games combined to go 89-45 (.664) in these contests. Over the rest of the season, this group went 51-63 in such games (.447); the five worst teams in this regard on July 8 combined to go 58-53 afterward).

The Yankees themselves are a good example of this. They have been one of the worst teams in one-run games this season, but last year they were one of the best. In 2016, they went 24-12 in one-run games and their .667 winning percentage was second highest in baseball. Only Texas — which set the modern record for winning percentage in one-run games by going 36-11 (.766, the best since 1900) — was better. This season, the Rangers are 10-15 in games decided by a single run, which is the fourth-worst mark in baseball.

This does not necessarily guarantee that the Yankees’ record in close games will improve, but Thursday certainly was a step in the right direction.

Yankees videos

Said Girardi: “It’s good to be on the other side.”