NEW YORK — Stephen Drew hit a tying single off Mariano Rivera with two outs in the ninth inning, then Shane Victorino lined a go-ahead single in the 10th that sent Boston past the Yankees 9-8 on Thursday night.
Down to their last strike against Rivera, the Red Sox rallied in the opener of a four-game series loaded with playoff implications.
New York erased a 7-2 deficit with six runs in the seventh.
The Red Sox won for the 10th time in 12 games and the Yankees had their three-game winning stopped.
Jacoby Ellsbury singled with one out in the 10th off Joba Chamberlain (2-1) and stole second. Victorino held up on a half-swing, umpire Joe West ruled, and lined a single that scored Ellsbury.
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
At Oakland, Calif., 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
At Anaheim, Calif., 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 21/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 61/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
At Baltimore, 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
At Kansas City, Mo., 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.
Diamondbacks 4, Giants 2
At San Francisco, Paul Goldschmidt broke out of a slump with two hits and two RBIs, and Martin Prado and Aaron Hill also drove in runs to help Arizona beat San Francisco.
Trevor Cahill (6-10) won his third straight decision since coming off the disabled list. He allowed two runs and six hits in five innings, walking four and striking out three.
Brad Ziegler pitched the ninth for his eighth save.
Pablo Sandoval had two hits and drove in a run for the Giants, who have lost three of four. Hector Sanchez also drove in a run and Brandon Belt had two hits. Ryan Vogelsong (3-5) gave up four runs and eight hits over 42/3 innings for the Giants.
Reds 6, Cardinals 2
At Cincinnati, Todd Frazier hit two homers, including the first of Cincinnati's three off Lance Lynn, and the Reds recovered from a 16-inning loss by overpowering the St. Louis Cardinals, taking three of four in their final series of the season.
Jay Bruce and Shin-Soo Choo also hit solo homers off Lynn (13-10), who lasted five innings and gave up three homers for only the second time in his career. Frazier also connected off Seth Maness for the third multihomer game of his career.
By winning their final series together, the Reds tightened the NL Central race and ended the Cardinals' dominance. St. Louis had won the last seven series between them. Cincinnati's lone loss was 5-4 in 16 innings on Wednesday night.
Left-hander Tony Cingrani (7-3) returned from a sore back and did a little bit of everything. He pitched into the sixth inning, gave up two runs, bunted for a hit, stole a base and scored.
David Freese homered for the Cardinals, who have lost six of eight. With first-place Pittsburgh idle, the Cardinals slipped to 11/2; games behind the Pirates while the Reds moved to 3 games out.