ST. PETERSBURG, Fla. - The New York Yankees used Alex Rodriguez's big game to get a win on the road, and that was the most important part for the slugger.

Rodriguez inched closer to Willie Mays with two more home runs, and the Yankees beat the Tampa Bay Rays 5-4 on Friday night.

"We needed this one badly," Rodriguez said after New York's fourth victory in 10 games this season.

Rodriguez hit a solo shot in the second, driving an 0-1 pitch from Nathan Karns an estimated 471 feet to centre. He connected again in the sixth, belting a two-run drive to left against Ernesto Frieri for homer No. 658 — just two shy of Mays for fourth place on baseball's career list.

"I am," Rodriguez said when asked if he is surprised by his start. "Hopefully it keeps going."

Rodriguez, who missed last season because of a drug suspension, also had a tiebreaking RBI single on a 3-2 pitch in the eighth against Kevin Jepsen (0-1). Brett Gardner, who came in to run for Carlos Beltran after his leadoff single, stole second before Rodriguez singled to centre with two out.

Rays manager Kevin Cash said there was no consideration given about intentionally walking Rodriguez, who is batting .344 with four homers and 11 RBIs.

"With Kevin Jepsen on the mound, we'll pitch to anyone in baseball," Cash said.

It was Rodriguez's first multihomer game since May 23, 2012, and No. 61 for his career. He also moved past former teammate Derek Jeter for ninth place on the runs scored list with 1,925.

"Without Alex we're going to lose that ballgame," Yankees manager Joe Girardi said. "Just a great night for Alex."

After Dellin Betances (2-0) threw a scoreless inning, Andrew Miller got the final four outs for his third save.

Allan Dykstra and Logan Forsythe hit consecutive homers in the fourth to give Tampa Bay a 4-2 lead. Dykstra had been 1 for 15 this season before hitting a three-run drive off Adam Warren for his first major league homer.

Stephen Drew put the Yankees up 2-0 in the fourth with his 100th career homer.

Karns allowed two runs and two hits in five innings. He struck out seven and walked four.

Warren gave up four runs and six hits over four innings.

Rays third baseman Evan Longoria went 1 for 3 and walked once while serving as the designated hitter. He left Thursday night's game at Toronto in the eighth inning with a bruised left hip after getting hit by a pitch.

TRAINER'S ROOM

Yankees: Gardner (right wrist) was out of the starting lineup for the third straight game. He could start Saturday ... RHP Ivan Nova (elbow surgery) threw 20 pitches in his second batting practice session. ... INF-OF Jose Pirela (concussion) hit off Nova.

Rays: RHP Alex Cobb (right forearm tendinitis) said he might throw off a mound in seven to 10 days. ... Closer Jake McGee (right elbow surgery) is nearing the start of a minor league rehab assignment.

MORE A-ROD

It was Rodriguez's sixth multihomer game, and first since May 17, 2011, against the Rays. He went 3 for 4 while the rest of the Yankees' lineup had two hits in 26 at-bats.

BROTHERS

Stephen Drew and his brother J.D. Drew (242) are the eighth set of brothers with at least 100 homers apiece. The list includes Joe and Vince DiMaggio.

UP NEXT

Yankees: Saturday starter Masahiro Tanaka (1-1, 7.00 ERA) has lasted just four and five innings in his first two starts.

Rays: RHP Jake Odorizzi (2-0, 0.61 ERA) gets the ball for Tampa Bay. He has won consecutive starts of six-plus innings, two or fewer hits and one run or less.