NEW YORK — Gary Sanchez homered and almost hit another while Tampa Bay was trying to intentionally walk him Saturday, leading Masahiro Tanaka and the hard-charging New York Yankees to their season-best seventh straight win, 5-1 over the Rays.

The Yankees closed within three games of AL East-leading Boston, their closest to the lead since mid-April.

It was scoreless in the sixth when Jacoby Ellsbury hit a two-run homer and Sanchez followed with his 13th homer 33 games this season.

In the eighth, after Ellsbury’s double put runners on second and third with no outs, the Rays seemed set to walk Sanchez.

Catcher Bobby Wilson moved wide as reliever Enny Romero lobbed in his first pitch at 52 mph, but the ball drifted close to the plate and Sanchez socked it to the warning track for a sacrifice fly.

MARINERS 14, ATHLETICS 3: Felix Hernandez pitched six scoreless innings as Seattle won at Oakland, California.

Nelson Cruz had three hits and three RBI, Nori Aoki also had three hits and drove in two runs, and Kyle Seager hit his 28th home run to help the Mariners to their seventh win in eight games against the A’s this season.

ORIOLES 11, TIGERS 3: Matt Wieters hit two of Baltimore’s four home runs at Detroit, and the Orioles chased Jordan Zimmermann in the second inning to move back ahead of the Tigers in the AL wild-card race.

Adam Jones and Chris Davis homered in the first inning off Zimmermann (9-6), and Wieters connected in the second and sixth.

ROYALS 6, WHITE SOX 5: Whit Merrifield hit a go-ahead two-run double in a three-run seventh inning and Kansas City held on at Chicago.

Royals closer Wade Davis gave up a single to Tyler Saladino and a double to Adam Eaton to lead off the ninth before Melky Cabrera’s infield single cut the deficit to one.

TWINS 2, INDIANS 1: Joe Mauer’s single off Joe Colon scored Brian Dozier from second in the 12th inning to lift Minnesota at Minneapolis.

NATIONAL LEAGUE

CARDINALS 5, BREWERS 1: Adam Wainwright pitched eight strong innings to help St. Louis win at home.

DODGERS 5, MARLINS 0: Los Angeles pitcher Rich Hill was removed after throwing seven perfect innings at Miami. The Marlins finished with two hits.

NATIONALS 3, PHILLIES 0: Bryce Harper hit a three-run homer in the eighth inning to lift Washington at home.

REDS 8, PIRATES 7: Joey Votto celebrated his 33rd birthday with four hits, including a home run, and Cincinnati triumphed at Pittsburgh.

PADRES 6, ROCKIES 3: Left-hander Christian Friedrich matched his career high with 10 strikeouts in seven brilliant innings to win for the first time since June 23, leading San Diego at home.

BRAVES 4, METS 3: Adonis Garcia’s tiebreaking single in the 10th inning scored Dansby Swanson from third base and Atlanta won at home to snap New York’s six-game winning streak.

GIANTS 11, DIAMONDBACKS 3: Hunter Pence had three hits, including a solo homer, and Johnny Cueto pitched seven solid innings to lead San Francisco at Phoenix.

INTERLEAGUE

ASTROS 2, CUBS 1: Rookie Alex Bregman homered, Collin McHugh combined with his bullpen on a two-hitter and Houston won at home as it tries to gain ground in the AL wild- card race.