Craig Breslow (5-2) got the win and Koji Uehara earned his 18th save, extending his scoreless streak to 26 innings over 23 games.
Lyle Overbay's two-out, two-run single capped the in the seventh that put the Yankees ahead 8-7.
ASTROS 3, ATHLETICS 2
OAKLAND, Calif. (AP) Jose Altuve had two hits and drove in a run to back a stellar outing by Brad Peacock and Houston knocked Oakland out of first place in the AL West.
Trevor Crowe singled, doubled and scored to help the Astros to their third win in the last four games against their division rivals. Oakland had won 11 of the first 12 meetings between the teams.
Peacock, part of the offseason trade that sent infielder Jed Lowrie to the A's, carried a shutout into the eighth inning, finishing with nine strikeouts and one walk.
Chris Carter, who was also included in the deal with Oakland, singled to drive in Houston's first run off Sonny Gray (2-3).
The A's went into the night tied with Texas for first place but couldn't get much going against Peacock (4-5).
Josh Fields recorded the final four outs for his third save.
ANGELS 6, RAYS 2
ANAHEIM, Calif. (AP) Collin Cowgill hit a three-run double, one of 11 hits Los Angeles had against reigning AL Cy Young winner David Price through his first 2 1-3 innings, and Jerome Williams ended a streak of eight straight losing decisions for the Angels.
Tampa Bay's ninth loss in 12 games, coupled with Boston's win at New York, dropped the Rays 6 1-2 games behind the AL East-leading Red Sox. The Rays complete their 10-game West Coast trip with three at Seattle.
Williams (6-10) allowed two runs and six hits over 6 1-3 innings, struck out seven and walked two as the Angels earned a split of the four-game series. The right-hander was winless in his previous 13 starts with a 6.58 ERA since winning at Baltimore on June 12.
Price (8-7) was charged with six runs while striking out six. The three-time All-Star left-hander has lost consecutive starts for the first time since dropping three straight from July 20-Aug. 2, 2011.
ORIOLES 3, WHITE SOX 1
BALTIMORE (AP) Miguel Gonzalez allowed one run over seven innings and Baltimore hit three solo home runs.
Adam Jones, J.J. Hardy and Brian Roberts homered off Jose Quintana (7-6) to provide Baltimore with a much-needed win. The Orioles were coming off a 3-6 trip that dropped them four games off the pace in the AL wild-card race.
Jones' shot in the first inning gave him 30 home runs for the season and 100 RBIs for the first time. Hardy and Roberts connected in the fifth, increasing Baltimore's major league-leading home run total to 188.
Gonzalez (9-7) gave up four hits all singles walked one and struck out six to earn his first win in seven starts since July 20. He was 0-4 in that span.
Jim Johnson worked a perfect ninth for his 42nd save.
Dayan Viciedo had two hits for the White Sox, who have dropped seven straight. Chicago is an AL-worst 24-49 on the road and 32-48 in games decided by one or two runs.
ROYALS 7, MARINERS 6, 13 innings
KANSAS CITY, Mo. (AP) Mike Moustakas homered to lead off the bottom of the 13th inning for Kansas City.
Moustakas homered to right on an 0-2 pitch from Chance Ruffin (0-1), who had not pitched in the majors since 2011.
Louis Coleman (3-0), the eighth Royals pitcher, retired the only batter he faced in the top of the 13th.
Kansas City rallied from five runs down and led 6-5 in the ninth before Raul Ibanez homered off Greg Holland with two outs to it. It was Holland's first blown save since May 6 to end his streak of 31 consecutive saves.
Billy Butler went 5 for 5, matching his career high in hits for the Royals, while Emilo Bonifacio went 4 for 6.
The teams combined to use 44 players, including 14 pitchers.