NEW YORK — Evan Longoria homered twice and drove in three runs, Matt Moore ended a personal three-game skid and the Tampa Bay Rays beat the New York Yankees 8-3 Thursday night.

Yunel Escobar also homered as Tampa Bay sent the Yankees to their seventh loss in nine games.

Longoria reached 500 career RBIs with a sacrifice fly in the third inning. He homered against Andy Pettitte (5-5) leading off the sixth and connected off Joba Chamberlain to open the eighth.

Escobar hit a two-run shot off Boone Logan later in the eighth. Tampa Bay had 14 hits after amassing 15 in a 6-2 win over Boston on Wednesday night.

Moore (9-3) pitched into the seventh inning and gave up three runs.

The 24-year-old lefty started the season at 8-0 before yielding 20 runs over 12 1-3 innings in three starts this month. He blanked the Yankees until the sixth when two walks and a single loaded the bases with no outs.

A wild pitch scored one run, Robinson Cano had a sacrifice fly and Travis Hafner followed with an RBI grounder that pulled the Yankees within 4-3.

Jose Lobaton opened the scoring with a sacrifice fly in the second following a wild pitch by Pettitte. Ben Zobrist had an RBI single in the third in the Rays' first visit to the Bronx this year.

Desmond Jennings and Sean Rodriguez had consecutive two-out doubles in the seventh to chase Pettitte, making his first start as a 41-year-old — his birthday was Saturday.

Jennings put Pettitte in trouble on the first pitch of the game, hitting a double that landed on the left-field line for his first of his three hits.

The Rays started the third with three straight singles. Jennings led off with a single and went to second when the ball scooted under center fielder Brett Gardner's glove for an error. After Rodriguez singled, Zobrist, who came in 9 for 22 (.409) against Pettitte, drove in Jennings with a single.

Longoria's sacrifice fly made it 3-0 and gave the All-Star third baseman 500 RBIs in 710 games, eighth quickest to reach the mark in major league history.

In 6 2-3 innings, Pettitte gave up five runs and nine hits. He has given up 14 runs in four starts since returning from the disabled list June 3.

NOTES: Tampa Bay played its 2,500th game in franchise history. The Rays, who started out as the Devil Rays in 1998, are 1,141-1,359 overall. Current Yankees pitching coach Larry Rothschild was Tampa Bay's first manager. Current Rays bench coach Dave Martinez singled for the team's first hit. ... Rays ace David Price (left triceps strain) is scheduled to make his first rehabilitation start Friday for Class A Charlotte. ... There was a moment of silence for actor and Yankees fan James Gandolfini, who died Wednesday. ... Yankees broadcaster and former catcher John Flaherty was in the Rays' first lineup. ... Yankees OF Vernon Wells went 0 for 3 and is 6 for 59 in June.