ST. PETERSBURG, Fla. - Alex Rodriguez continues his march toward the milestone that shall not be named.

The 39-year-old hit two home runs Friday night, drawing within two of Willie Mays for fourth place on the all-time list, and added a tiebreaking single with two outs in the eighth in the Yankees' 5-4 victory over the Rays at Tropicana Field.

"Without Alex, we were going to lose that ballgame,'' Joe Girardi said.

Rodriguez gave the Yankees a 1-0 lead with his first homer, a blast to left-center off Rays righthander Nathan Karns in the second inning. It went 471 feet, according to MLB Advanced Media, the longest home run in the majors in 2015.

His second came in the sixth, a two-run shot down the leftfield line off righthander Ernesto Frieri that tied it at 4-4.

He snapped that tie two innings later with a two-out single off righty Kevin Jepsen. Carlos Beltran led off the inning with a single and pinch runner Brett Gardner -- who did not start because of a sore right wrist -- stole second with two outs to set up A-Rod's liner into center.

The homers gave Rodriguez 658 in his career, putting him within two of Mays. But the Yankees have made it clear that they don't plan on paying him the $6-million bonus when and if he reaches that plateau, or any of the other $6-million homer bonuses in his contract. Their perspective: All of those achievements are tainted by his PED use, are not marketable milestones and won't be recognized.

The homer gave A-Rod 1,924 runs, sending him past Derek Jeter for sole possession of ninth place in baseball history.

Rodriguez far and away has been the Yankees' most interesting player this season and their most dangerous at the plate. He leads the Yankees with four homers and 11 RBIs and has a slash line of .344/.432/.781.

The Yankees got only four innings out of Adam Warren but terrific work from their bullpen. Esmil Rogers (21/3 innings), Justin Wilson (one-third), Dellin Betances (one inning) and Andrew Miller (11/3 innings) shut out the Rays over the final five innings. After allowing an infield single to start the ninth, Miller struck out the next three batters to record his third save.

A-Rod's first home run and the 100th homer of Stephen Drew's career -- he lined his third of the season over the wall in right-center in the fourth -- gave the Yankees a 2-0 lead. But Warren allowed four runs and six hits in four innings, with all of the runs coming on back-to-back homers by Allan Dykstra and Logan Forsythe in a span of five pitches in a 33-pitch fourth.

With one out in the fourth, Evan Longoria hit a hard grounder that Didi Gregorius stopped with a dive to his left. His throw came in low to Mark Teixeira, who has successfully scooped such balls out of the dirt hundreds of times in his career. This was not one of them, however, as the ball bounced off his glove for what was scored an infield hit.

Desmond Jennings walked and Warren fell behind Dykstra 2-and-0 before delivering a wheelhouse 92-mph fastball that the rookie -- off to a 1-for-15 start -- lined off the foul-pole screen in right for his first career homer. Forsythe then launched a shot to left-center for a 4-2 Tampa Bay lead.