Evan Longoria homered twice and drove in five runs and pinch-hitter Matt Joyce delivered a go-ahead double in the eighth inning Sunday that sent the Tampa Bay Rays over the Houston Astros 14-10 for a three-game sweep.

B.J. Upton homered for the third straight day and drove in four runs for the Rays, who have won four in a row.

Longoria came within a triple of the cycle and had his first multihomer game since 2009 — one of his homers was initially ruled a single until the call was overturned after a video replay review.

Longoria had eight hits, including three home runs, and 10 RBIs in the series while going without batting gloves for the first time since his rookie season.

Joyce's two-out, two-run double put the Rays ahead 9-8. Casey Kotchman followed with a two-run single.

With all their position players on the bench used, Tampa Bay sent Saturday's starting pitcher, Wade Davis, to bat as a pinch-hitter in the ninth. He got his first career hit on a single to right field, and was later thrown out at home in a collision that shook up catcher Carlos Corporan.

Longoria then hit a three-run homer with two outs to give the Rays a four-run lead.

The Astros had taken an 8-7 lead in this wild, back-and-forth game on a solo homer by Jeff Keppinger off J.P. Howell (1-1) in the seventh.

Matt Downs hit a two-run homer off Joel Peralta in the eighth inning to get Houston within 11-10. Reliever Adam Russell gave up a single to Clint Barmes before a sacrifice bunt and a double play ended the inning.

Houston reliever Wilton Lopez (1-4) took the loss.

Upton's homer gave the Rays a 3-0 lead in the first. He drove in another run in the third to end the three-game series with seven RBIs.

Longoria's first homer was a two-run shot and came in the sixth. The ball, which bounced off the hands of a fan in the first row of the Crawford Boxes, was originally ruled in play and he was thrown out at second. The call was changed following the replay, and that made the score 7-all.

Rays starter Jeff Niemann, who is from Houston and played at Rice, allowed seven hits and five runs in his second game since coming off the disabled list with a back injury.

Niemann singled on a grounder in the second for his first career hit. He became the first Tampa Bay pitcher to get a hit this season after the staff entered Sunday's game 0 for 19.

Houston starter J.A. Happ yielded nine hits and five runs in five innings.

NOTES: Carlos Lee has three triples this season to tie a career-high from 2001 with the White Sox. ... The Rays return home on Monday after playing 30 of their last 47 games on the road. ... Upton had hit just one homer in the previous 30 games before this series.