Alex Cora said he felt a tinge of October in the May air on Thursday night, when the Yankees erased a four-run deficit late in the game which ended in a 5-4 Red Sox win.

“Their at-bats after the seventh inning are amazing,’’ Cora said of the Yankees, who scored four runs in the seventh and threatened in the eighth inning. “What they do here, for them it’s fun to watch. For me it’s ‘Oh, god, here we go again.’ ”

Fortunately, for the Red Sox, J.D. Martinez followed the four-run Yankees seventh with a solo homer off Dellin Betances for the game-winner — which dulled the crowd.

“It was like back in ’04, ’05, whenever I played here. The three games felt like the championship series last year, it was that loud,’’ said Cora, who was the Astros’ bench coach last season. “They got something going on good there, but we also have something going on good here. Going to be fun the rest of the year.’’

The days of a major league player participating in all 162 games are gone, replaced by managers often talking about preserving players’ health by giving them a day off.

So, with the Yankees riding an eight-game winning streak and having won 17 of 18 before Thursday’s loss, Aaron Boone was asked if all the winning had made it easier or harder to rest players.

“I would say a little bit easier, but it is always hard to rest your dudes when you know what they bring to the table,’’ said Boone, who rested switch-hitting center fielder Aaron Hicks against lefty Eduardo Rodriguez. “You have to balance that by trying to keep a long view as well. There is always urgency in the day and we are putting all we can into winning the day, but I do have to take a step back and look at the big picture every now and then. I value the rest and I value getting those guys a day off.’’

Because the Yankees carry 13 pitchers, Boone’s bench consists of three players every night. On Thursday, it was Austin Romine, Neil Walker and Hicks. Ronald Torreyes started at third (though Walker pinch hit for him in the seventh and stayed in) and Miguel Andujar was the designated hitter, which some view as half a day off.

“When you are winning, it allows to keep your bench fresh and frankly, even though the bench is pretty short, the guys that do come in have been productive,’’ Boone said. “The confidence I have in the guys I am putting in when a guy is getting a day off, I feel very comfortable.’’

Didi Gregorius started his 35th game (all at short), which was the most on the Yankees without being the DH. Gregorius, who went 0-for-5, but had an RBI on a fielder’s choice in the Yankees’ four-run seventh, might be in line for a bench seat Friday night against the Athletics since he is now hitless in 24 consecutive at-bats.

Aaron Judge, who went 1-for-2 with an RBI and three walks, started 30 games in right, one in center and four at DH going into Thursday, when he was in right.