ST. PETERSBURG, Fla. — Russell Martin hit a tiebreaking two-run homer in the eighth inning to help the Toronto Blue Jays overcome a poor start by 17-game winner J.A. Happ and avoid a three-game sweep by beating the Tampa Bay Rays 5-3 on Sunday.

With the win, Toronto has a one-game lead in the AL East over Boston, which lost 1-0 at Oakland.

Martin hit his 17th homer – he has gone deep nine times and driven in 24 runs over his last 18 games.

Happ was up to 85 pitches when he was pulled by Manager John Gibbons after Corey Dickerson’s RBI single put the Rays up 3-1 with two outs in the third.

Chris Archer struck out nine for Tampa Bay, running his AL-best total to 211.

ASTROS 7, RANGERS 6: George Springer and Evan Gattis homered for Houston, which avoided a series sweep at Texas and snapped the Rangers’ seven-game winning streak.

Houston is still 91/2 games behind Texas in the AL West with four weeks left in the regular season.

TIGERS 6, ROYALS 5: Justin Upton hit a two-run homer with two outs in the eighth inning, sending Detroit to a win at Kansas City, Missouri.

YANKEES 5, ORIOLES 2: Chase Headley and Austin Romine each had two RBI as visiting New York avoided a three-game sweep to remain afloat in the AL wild-card race.

WHITE SOX 13, TWINS 11: Jose Abreu hit two three-run homers and drove in a career-best seven runs, and Chicago used Tim Anderson’s two-run double in the 12th inning to win at Minneapolis.

ANGELS 4, MARINERS 2: Albert Pujols and C.J. Cron hit back-to-back home runs in the first inning and six relievers combined to shut down host Seattle after starter Matt Shoemaker was hit in the head with a line drive.

NATIONAL LEAGUE

CUBS 3, GIANTS 2: Jason Heyward tied it with a single in the ninth inning, and his single to left-center in the 13th won it as Chicago won at home to take three of four games in a possible playoff preview.

METS 5, NATIONALS 1: Rookie Seth Lugo allowed one run and six hits over seven innings, and Curtis Granderson and Jay Bruce each hit a two-run homer as New York won at home.

The Mets won for the 11th time in 15 tries and stayed within one game of St. Louis for the second NL wild-card slot.

DODGERS 7, PADRES 4: Jose De Leon struck out nine while winning his major league debut, and pinch-hitter Yasmani Grandal drove in three runs as Los Angeles rallied to win at home and increase its NL West lead to three games over the Giants.

CARDINALS 5, REDS 2: Randal Grichuk and Kolten Wong homered as St. Louis snapped a three-game losing streak with a win at Cincinnati.

DIAMONDBACKS 8, ROCKIES 5: Socrates Brito snapped a seventh-inning tie with a three-run homer for visiting Arizona.

BREWERS 10, PIRATES 0: Domingo Santana had his first career two-home run game, Jonathan Villar hit his first grand slam and Chris Carter hit his 32nd homer as visiting Milwaukee finished a three-game sweep.

BRAVES 2, PHILLIES 0: Julio Teheran pitched six sharp innings and Matt Kemp homered as Atlanta won its sixth straight.

INTERLEAGUE

INDIANS 6, MARLINS 5: Lonnie Chisenhall capped a three-run rally with a two-out RBI single in the ninth inning at Cleveland.