ST. PETERSBURG -- Matt Joyce came through again.

Home runs by the Rays slugging right fielder at the most timely of moments have become almost expected this season, and his three-run blast Friday night was the difference in a 3-2 win over the Yankees at Tropicana Field with a sellout crowd of 36,973 watching.

With the victory, the Rays matched their season-high winning streak with their seventh in a row to move to 64-38 on the season and within one game of the first-place Yankees, who lost for just the sixth time in their past 23 games. The Rays now hold a 5-4 edge in the season series against their American League East rival.

With the Rays trailing, 2-0, John Jaso singled off Phil Hughes to lead off the bottom of the sixth and one out later moved to second on a wild pitch. Evan Longoria followed with a walk before Carlos Pena grounded into a force out at second to bring up Joyce.

In the sixth inning of Monday night's game, Joyce had smacked a two-out grand slam off Max Scherzer to break up the Detroit starter's bid for a no-hitter, which in turn gave Matt Garza a cushion to help him finish off his no-hitter. And earlier in the month, Joyce hit a two-out, pinch-hit grand slam off Minnesota's Matt Guerrier to reverse the Rays' fortunes in an 8-6 win over the Twins at Minnesota.

So Joyce followed a familiar story line when he connected with a 2-2 pitch and deposited the ball into the right-field stands to give the Rays the lead.

"It was a big win," Joyce said. "Obviously [the home run] came at a good spot. Phil was doing a great job of keeping us off-balance. We had a tough time with him. We put together some good at-bats, and I just put a good swing on a pitch that was up."

Hughes figured the two breaking balls he threw Joyce would allow him to bust a fastball inside to get the final strike.

"But it leaked out over the plate and he didn't miss it," Hughes said. "To a lefty, lower is better for him, so I wanted to get it [near the] belt ... I'll be thinking about that pitch for a while.

"I had some success earlier in the game going in there and I had thrown him a pretty good 2-1 curveball before that and I felt like it was the right pitch. He guessed right. That's the bottom line."

Wade Davis started for the Rays and experienced a less-than-auspicious beginning when Derek Jeter singled to lead off the first and Nick Swisher hit the sixth pitch of the game 380 feet into the right-field stands to give the Yankees a 2-0 lead.

"It's not a good feeling at all," said Davis. "You just have to keep telling yourself to stay strong and put a couple good innings together and give the team a chance to win."

Davis didn't buckle. Instead, the right-hander buckled down as the game settled into a pitchers' duel with Hughes.

After the first, Davis added six scoreless frames, aided greatly by an inning-ending double play in the sixth. With runners on first and second and one out, Jorge Posada grounded sharply to Pena. The Rays first baseman turned and threw to second baseman Jason Bartlett, who made a successful relay to Davis covering at first to complete the twin-killing.

The momentum gained seemed to carry over into the bottom half of the inning, when Joyce's blast interrupted a string of five scoreless frames from Hughes.

Davis retired the Yankees in order in the seventh, effectively bridging the gap to Joaquin Benoit and Rafael Soriano, who have been extremely effective at silencing the eighth and ninth innings this season.

"That must have really upset [Davis] or something," said Swisher of his home run. "You've got to give credit where credit is due. After that, he really seemed to find his groove."

Davis claimed his fourth straight victory to establish the longest winning streak of his career to go to 9-9 on the season and earn the praise of manager Joe Maddon, who called the outing the best of Davis' career.

Benoit sent the Yankees down in order in the eighth, and Soriano put the finishing touches on the win by retiring Alex Rodriguez -- who went 0-for-4 to remain at 599 career homers -- and Robinson Cano on popouts.

The game had a dramatic ending when Posada hit a shot between first and second that Pena dove to knock down. The Rays first baseman never quit on the play, managing to fight his momentum to where he briefly found a sitting position. He then delivered a sidearm strike to Soriano at first to record the game's final out.

"Both sides pitched really well tonight. Hughes was really good," Maddon said. "That's as good as I think I've seen him. I just thought it was a well-played game on both sides. They hit a two-run homer, we hit a three-run homer -- we win."