ST. PETERSBURG, Fla. — Using relievers from the start with the hope of getting his starters an extra day of rest resulted in Aaron Boone calling for his late-inning arms to preserve a lead on Monday night.

The plan, which Boone said won’t be in play for the AL wild-card game against the A’s a week from Wednesday, worked very well and helped the Yankees to a 4-1 win over the Rays in front of 13,832 at Tropicana Field.

“One run, we will take that,’’ Boone said of the run Sonny Gray gave up in the fourth inning when the first of two Gary Sanchez’s passed balls helped build the Tampa Bay run. “[Stephen] Tarpley was terrific, Sonny was good and then the guys just rolled it out and it worked pretty well tonight.’’

Better than well since the Rays were limited to two hits, Tommy Pham’s double in the fourth that was followed by Joey Wendle’s infield single. Both came off Gray.

The Yankees’ victory put pressure on the A’s to beat the Mariners in Seattle on Monday night to remain 1 ½ games back of the Yankees who have six tilts remaining. An A’s loss would have pushed the Yankees’ cushion to 2 ½ lengths in the chase for the right to host the wild-card game.

The loss eliminated the Rays from wild-card contention and the season series with the Yankees is even at 8-8, though the Rays are 5-2 at Tropicana Field.

David Robertson, the fifth of eight Yankees pitchers, was asked to protect a 3-1 lead when he entered at the start of the sixth inning. He walked Matt Duffy and Ji-Man Choi to start the frame in front of getting Pham to force Choi at second. With runners at the corners and one out Robertson fanned Wendle and then held his breath that center field was deep enough to hold Brandon Lowe’s drive.

Brett Gardner, who replaced center fielder Aaron Hicks (tight left hamstring) in the home fourth, raced to the warning track, caught the ball one step from the wall before banging his head into the fence and holding onto the ball.

“It was a fastball down the middle and he put a pretty good swing on it,’’ Robertson said of the 3-2 pitch. “Thank God, Gardy was out there. It was a game-saving play.’’

Robertson raised his hands as if signaling a touchdown when Gardner made the grab and Andrew McCutchen didn’t downplay the significance of the catch.

“It’s all turf so you don’t have the dirt to tell you the wall is coming up,’’ said McCutchen, a former center fielder. “That was just a major play. Saved two runs for us. That was huge.’’

McCutchen, who homered in the third for the game’s first run, and Aaron Judge doubled with one out in the seventh to hike the Yankees’ lead to 4-1.

From there Aroldis Chapman, Dellin Betances and Zach Britton closed it out, with Britton getting the final three outs for his third save as a Yankee.

With the score tied, 1-1, in the fifth inning Gardner dumped a bloop single into center that scored Judge who had walked and went to second on a passed ball charged to Nick Ciuffo. Gardner scored from first on Giancarlo Stanton’s double into the left-center gap.

Already without shortstop Didi Gregorius (right wrist cartilage tear) Hicks’ departure could be cause for concern even if he said he didn’t believe it was that serious of a problem.

So, too, was Sanchez being charged with two passed balls (he leads the majors with 17) and going 0-for-4 with two strikeouts. In 19 games since coming off the DL, Sanchez is 10-for-66 (.152).

Those are two major concerns heading into the Oct. 3 wild-card game, but the main story Monday night was that Boone’s plan to give his starters extra rest couldn’t have worked out any better.