DETROIT – Mark Teixeira and Eric Chavez hit solo home runs on consecutive pitches in the eighth inning to put New York ahead, and the Yankees held on to win in Detroit on Thursday.

Yankees manager Joe Girardi was ejected and threw his hat during a demonstrative argument with third base umpire Tim Welke after a fair-or-foul call in the fifth inning.

New York led early, and late, for a second straight victory after dropping the first two games.

RAYS 7, BLUE JAYS 1: Matt Moore (9-7) pitched six sharp innings and Jose Lobaton drove in three runs for a three-game sweep at St. Petersburg.

Moore gave up two hits in winning his third start in a row.

ROYALS 8, ORIOLES 2: Billy Butler came within a single of hitting for the cycle in Baltimore, ending the Orioles’ five-game winning streak.

NATIONAL LEAGUE

METS 6, MARLINS 1: R.A. Dickey pitched a complete game for his 15th win, stopping Jose Reyes’ 26-game hitting streak as New York ended a nine-game home losing skid.

Dickey (15-3) gave up five hits, struck out 10 and walked none.

Reyes, whose hitting streak was the best in the majors this season, went 0 for 4 against the All-Star knuckleballer.

CARDINALS 3, GIANTS 1: Adam Wainwright (10-10) pitched seven strong innings as St. Louis bounced back from a 15-0 blowout at home. Carlos Beltran hit his 27th homer for the Cards, who have won seven of 10.

DIAMONDBACKS 6, PIRATES 3: Jason Kubel homered twice and Joe Saunders (6-8) pitched seven effective innings at Pittsburgh.

NATIONALS 5, ASTROS 0: Michael Morse homered twice and Jordan Zimmermann matched his career high with 11 strikeouts as Washington completed a four-game sweep at home.

NOTES

ASTROS: Houston acquired infielder Tyler Greene, 28, from St. Louis. A first-round draft pick in 2005, Greene is hitting .218.

BLUE JAYS: Toronto placed third baseman Brett Lawrie on the 15-day disabled list.