Joe Girardi discusses Didi Gregorius’ recent hot streak.
Chris Iseman/

NEW YORK — As much as the Yankees are chasing the American League East-leading Red Sox, they’re also trying to fend off the Rays.

Tampa Bay wasn’t considered much of a threat in the division coming into the season, but the Rays entered Thursday four games above .500 and 1½ games behind the Yankees in third place. 

So this four-game series at Yankee Stadium is a significant one. 

Brett Gardner made sure the Yankees took the first game. 

Gardner blasted a solo homer in the bottom of the 11th inning to send the Yankees to a 6-5 walk-off win over the Rays in front of 44,033 at the Stadium.

“I’m just happy I was able to come through in a big spot like that,” said Gardner, who also scored the tying run in the ninth. 

Aroldis Chapman pitched perfect innings in the 10th and 11th to preserve the tie and earn the win. 

Yankees manager Joe Girardi wasn’t around to see the end of the game after he was ejected in the seventh for arguing balls and strikes. 

The Yankees (54-46) have won four straight and are now just a half game behind Boston.

The Yankees made it a one-run game in the eighth as pinch-hitter Matt Holliday hit into an RBI fielder’s choice against reliever Brad Boxberger, who then allowed a single to Todd Frazier before getting Tyler Wade to ground into an inning-ending double play. 

The Yanks tied it in the ninth.

Gardner led off with a triple to the left-center field gap against reliever Alex Colome. 

Clint Frazier then grounded out and Aaron…