The Tampa Bay Rays used one unlikely error to pick up another home victory against the New York Yankees.

B.J. Upton and Carlos Pena homered and the Rays took advantage of Mark Teixeira's first fielding blunder of the season, topping the Yankees 4-3 on Monday night.

"And again, just a team victory," Tampa Bay manager Joe Maddon said.

Matt Moore (5-5) allowed three runs while scattering nine hits over seven innings to win his fourth straight decision. The Rays stopped a two-game losing streak that had dropped them a season-high 7½ games behind the first-place Yankees in the AL East.

"The Yankees came in here at the top of the division and we've been hitting a little skid," Moore said. "Hopefully this is a sign for a lot of good things to come."

Tampa Bay has won the last eight games between the teams in Florida, including a season-opening three-game sweep.

Pinch-hitter Brooks Conrad delivered a tying RBI double against David Robertson (0-3) with two down in the seventh inning.

Teixeira then misplayed Elliot Johnson's sharp grounder over first base for his first error in 671 chances this year, enabling Conrad to score the go-ahead run. Teixeira shook his head after the ball scooted under his glove, allowing Johnson to reach third.

"I tried to look, but it was one of those after it goes by you, you go what just happened?" Teixeira said. "I didn't even get leather on it. Usually you can knock it down. I tried to look at video, but I couldn't really even tell what happened. I just missed it. I don't know if it hit the back of the base or the chalk or what. I still have to knock it down. That's the disappointing thing."

Upton and Pena connected against Freddy Garcia, filling in for the injured Andy Pettitte in a New York rotation also missing CC Sabathia.

Joel Peralta worked a perfect eighth for Tampa Bay, and All-Star Fernando Rodney finished for his 23rd save in 24 opportunities.

Teixeira, Robinson Cano and Curtis Granderson each drove in a run for the Yankees. Granderson's seventh-inning sacrifice fly made it 3-2.

Garcia made four starts before being moved into the bullpen after allowing six runs in 1 2-3 innings of a 7-5 loss to Detroit. The right-hander returned to the rotation to fill in for Pettitte, who was placed on the 60-day disabled list after he fractured a bone in his left leg when he was hit by a batted ball against Cleveland on June 27.

New York scored twice in the first with help from Hideki Matsui, the former Yankees star who overran Teixeira's routine fly to right field that dropped for an RBI double. Alex Rodriguez singled, sending Teixeira to third before Cano lined a single up the middle to stake Garcia to a quick 2-0 lead.

Moore escaped further damage by getting Nick Swisher to hit into an inning-ending double play.

Upton's sixth homer of the season trimmed New York's lead to 2-1, and Pena's second in three nights made it 2-all.

Yankees manager Joe Girardi said before the game that Garcia, who had made 10 appearances out of the bullpen since being removed from the rotation, would be limited to 75 pitches. Pena, who is 5 for 42 lifetime against the right-hander, homered on Garcia's 74th — and last — pitch.

Garcia allowed two runs and five hits in 5 1-3 innings.

NOTES: Matsui left in the second due to left hamstring tightness, which occurred chasing a Derek Jeter foul ball in the top of the inning. "I was running after it and it felt like I pulled something," Matsui said through a translator. "Right now I feel better. It just tightened up. Maybe a few days, but not to the point where I'll be on the DL." ... Rays RHP Jeremy Hellickson, who left his most recent start after being hit in the right shin by a line drive off the bat of Prince Fielder, threw a bullpen session and expects to make his next scheduled start on Thursday at Cleveland.