BALTIMORE — David Ortiz broke open a tight game with a three-run homer in the seventh inning, and the Boston Red Sox beat the Baltimore Orioles 5-2 Tuesday night for their sixth straight victory.

Jackie Bradley Jr. also homered for the Red Sox, who stretched their lead over Baltimore in the AL East to five games. After sweeping four games from the Yankees, Boston has won the first two of this pivotal four-game series.

Trey Mancini homered in his major league debut with the Orioles, who trail Toronto by a game for the first AL wild card. Kevin Gausman (8-11) allowed five runs and 10 hits in 6 1/3 innings.

Eduardo Rodriguez (3-7) pitched 6 1/3 innings of two-run ball for his first win in 11 starts since July 16. Craig Kimbrel worked the ninth for his 28th save.

BLUE JAYS 10, MARINERS 2

SEATTLE — J.A. Happ became the major leagues’ second 20-game winner and Russell Martin and Michael Saunders each hit a two-run homer, lifting Toronto over Seattle to move into first in the AL wild-card race.

Toronto took the lead with an eight-run fourth inning and moved a game ahead of Baltimore. Detroit remained 2 1/2 games behind the Blue Jays.

Seattle lost for the fourth time in five games to fall four games behind Toronto.

Happ (20-4) allowed two runs, six hits and a walk over five innings, striking out eight while winning for the 14th time in his last 15 decisions. He’s the first Toronto pitcher to reach 20 wins since Roy Halladay in 2008.

Martin and Saunders each homered off Hisashi Iwakuma (16-12) during the Blue Jays’ big inning.

GIANTS 2, DODGERS 0

LOS ANGELES — Eduardo Nunez and Brandon Belt homered to help San Francisco overcome injuries to All-Star pitcher Johnny Cueto and shortstop Brandon Crawford.

San Francisco pulled into a three-way tie for first place in the NL wild-card standings with the Mets and Cardinals. The Giants are five games behind the NL West-leading Dodgers with 11 to play.

Cueto (17-5) exited with a strained left groin in the sixth inning. Crawford came out with a dislocated left pinky in the second.

A team trainer checked on Cueto with Andrew Toles at bat. Cueto stayed in and walked Toles, then motioned that he was done.

Sergio Romo got his first save of the season.

Rich Hill (3-2) allowed a run and six hits over five innings.

ASTROS 2, ATHLETICS 1, 10 INNINGS

OAKLAND, Calif. — George Springer hit a go-ahead single in the 10th inning, and Houston beat Oakland.

Tony Kemp, who tied it with a pinch-hit double in the seventh, got things going with a leadoff double against Sean Doolittle (2-3) and Jake Marisnick sacrificed him to third to bring up Springer.

Chris Devenski (4-4) struck out four in 3 2-3 innings of relief for the win, and Ken Giles escaped a bases-loaded jam and closed it out for his 13th save. The Astros remain in the mix for the AL wild card.

Jose Altuve’s eighth-inning single gave him 200 hits in three straight seasons, the first to do so since Ichiro Suzuki from 2001-10.

Oakland’s Danny Valencia was ejected at the end of the ninth by plate umpire Marty Foster after striking out.

YANKEES 5, RAYS 3

ST. PETERSBURG, Fla. — Rookie slugger Gary Sanchez hit his 17th homer in 42 games this season, a three-run shot in a four-run seventh inning for the Yankees.

The banged-up Yankees are 3 1/2 games behind Baltimore for the second AL wild card.

Sanchez gave the Yankees a 5-2 lead with his drive off Brad Boxberger (4-3).

Mark Teixeira hit a solo shot in the fourth for New York, which was swept in a four-game series at Boston last weekend and had lost seven of eight overall.

Luis Severino (3-8) pitched 1 1/3 innings of scoreless relief to earn the win. Dellin Betances got three outs for his 12th save.

TIGERS 8, TWINS 1

MINNEAPOLIS — Matt Boyd breezed through eight innings, backed by home runs from James McCann and Miguel Cabrera, and Detroit stepped forward in the AL wild-card race.

With Baltimore’s loss to Boston, the Tigers cut the deficit between them and the second spot to 1 1/2 games with 12 to go.

Boyd (6-4) allowed three hits, including Robbie Grossman’s seventh-inning homer.

McCann, in the designated hitter role for the injured Victor Martinez, connected for a three-run shot during Detroit’s a four-run sixth against Hector Santiago (12-9).

CARDINALS 10, ROCKIES 5

DENVER — Adam Wainwright was shaky on the mound and shined at the plate with a career-high four RBIs, helping St. Louis move into a three-way tie for the top NL wild card.

The free-swinging Wainwright lined a two-run double in the second inning and brought in two more with a bloop single in the fifth. Matt Adams and Jedd Gyorko homered to help the Cardinals pull even with the New York Mets, who lost at home to last-place Atlanta for the second straight night.

Wainwright (12-9) gave up four runs in 5 1/3 innings.

Daniel Descalso, Charlie Blackmon and Gerardo Parra homered for Colorado, and Jorge De La Rosa (8-9) allowed eight runs — seven earned — in 4 2/3 innings.

INDIANS 2, ROYALS 1

CLEVELAND — Pinch-hitter Brandon Guyer hit a game-ending RBI single, helping Cleveland inch closer to the AL Central title.

Guyer’s two-out hit off Joakim Soria landed just fair in the right-field corner and scored Coco Crisp. Guyer was the third pinch hitter of the inning used by manager Terry Francona.

Cleveland leads Detroit by seven games in the division. The Indians haven’t won the AL Central since 2007.

The Royals, the reigning World Series champions, will be eliminated from contention in the division if they lose to Cleveland on Wednesday night.

Alex Gordon singled in a run for Kansas City, and Brian Flynn (1-2) got the loss.

Andrew Miller (9-1) got five outs for the win.

RANGERS 5, ANGELS 4

ARLINGTON, Texas — Rookie Nomar Mazara hit his 20th homer in another testy game with multiple ejections and the Rangers moved closer to their second consecutive AL West title.

Texas (90-62) cut its magic number to two to clinch the seventh division title in franchise history.

Mazara hit a 438-foot drive off rookie Daniel Wright (0-4), a two-run shot in the fourth that put the Rangers up 4-3.

Nick Martinez (2-3) worked 3 1/3 scoreless innings in relief, and the right-hander made a spectacular play in the fifth, when he reached behind his back for a no-look snag of Andrelton Simmons’ hard liner and turned it into a double play.

Sam Dyson worked the ninth for his 35th save in 40 chances.

MARLINS 1, NATIONALS 0

MIAMI — Giancarlo Stanton homered to back a strong outing by Jose Fernandez, who pitched eight innings and struck out 12 for the Marlins.

Fernandez (16-8) allowed three hits without a walk to outduel Washington’s Tanner Roark (15-9) who pitched seven innings and allowed one run.

David Phelps pitched the ninth for his fourth save in 10 chances.

The Nationals were held to four hits in their fourth consecutive loss.

Stanton connected for his 27th homer in the sixth inning. Stanton also homered in Monday’s 4-3 win.

BRAVES 5, METS 4

NEW YORK — Mets nemesis Julio Teheran pitched seven more sparkling innings and the last-place Braves blunted New York’s bid to extend its NL wild-card lead.

The Mets nicked the Braves’ bullpen for three runs in the eighth but couldn’t complete the comeback. The Braves have the worst record in the NL, yet have won four straight.

Teheran (6-10) gave up five hits and left with a 5-1 lead. Dating to the final time he saw the Mets last season, he’s 3-0 with a 0.73 ERA in five starts against them.

Jim Johnson pitched the ninth for his 16th save in 19 chances.

Robert Gsellman (2-2) lost in his fifth major league start.

CUBS 6, REDS 1

CHICAGO — Jon Lester overcame an injury scare to throw seven strong innings, and the Cubs moved closer to securing the NL’s best record.

Lester (18-4) extended his scoreless streak to 21 innings before Jose Peraza’s RBI triple in the fifth. He stayed in after Joey Votto’s comebacker in the sixth left him with a welt on the wrist of his glove hand.

The Cubs’ 96th win reduced their magic number to three over Washington for clinching home-field advantage throughout the NL playoffs.

Josh Smith (3-2), making a spot start in a bullpen game for the Reds, allowed one run and three hits in three innings. Brandon Phillips had two hits for Cincinnati.

PIRATES 6, BREWERS 3

MILWAUKEE — Andrew McCutchen, Jody Mercer and Josh Bell each drove in two runs, and Pittsburgh kept its faint playoff hopes alive.

The Pirates have won fifth of six to improve to .500 (75-75) for the first time since they were 69-69 on Sept. 8.

Jared Hughes (1-1) pitched an inning for the win and Tony Watson worked the ninth for his 14th save.

Milwaukee right-hander Matt Garza was charged with five runs and eight hits in four-plus innings.

PHILLIES 7, WHITE SOX 6

PHILADELPHIA — Odubel Herrera homered and drove in three runs, leading Philadelphia to the win.

Tommy Joseph and Roman Quinn added two hits apiece and combined to drive in three runs for the Phillies. Herrera, who hits between Joseph and Quinn in the lineup, is 15 for 28 in his last seven games.

Melky Cabrera hit a three-run homer for the White Sox, who have lost four straight. James Shields (5-18), winless since July 26, allowed six earned runs and nine hits in 5 1/3 innings.

Trailing 7-3 in the ninth, the White Sox pulled within one on a two-out wild pitch and a two-run double from Adam Eaton. But Michael Mariot got Tim Anderson to ground out for his first career save.

Philadelphia’s Jake Thompson (3-5) gave up three runs and four hits over five innings.

PADRES 5, DIAMONDBACKS 2

SAN DIEGO — Adam Rosales homered and drove in four runs and rookie Ryan Schimpf scored three times to lead San Diego.

The start of the game was delayed 70 minutes by rain. It was only the seventh delay in Petco Park’s 13-season history, the sixth because of rain. The other one was due to a swarm of bees during a game in 2009.

Keith Hessler (1-0) got one out for his first career victory and Brandon Maurer got his 12th save.

Zack Godley (4-4) allowed two runs in two innings and got the loss.