PHILADELPHIA — Zach Eflin continued to shine for Philadelphia with a four-hitter over seven shutout innings, and Rhys Hoskins hit a three-run homer to help the Phillies beat the New York Yankees 3-0 on Wednesday night.

Eflin, acquired in the 2014 trade that sent fan favorite and former NL MVP Jimmy Rollins to the Los Angeles Dodgers, won his fifth straight start and kept the surprising Phillies in the thick of the NL East race.

Eflin (6-2) became the first Phillies pitcher to win five starts in a month (he had a 1.76 ERA in June) since Cole Hamels went 5-0 in May 2012. Eflin has turned into a stopper of sorts for Philly: He won his fourth game this month following a Phillies loss. Eflin walked two, struck out six and helped the Phillies avoid a three-game sweep before beginning a key four-game series against the division rival Washington Nationals.

The Yankees, who have the best record in baseball at 52-26, sat slugging outfielder Aaron Judge for the series finale. Manager Aaron Boone wanted to pair a day of rest with Thursday’s off day to keep Judge fresh when the team returns to the Bronx for a weekend set with Boston. The Yankees and Red Sox have been neck and neck atop the AL East, the only teams with a legitimate shot at the division tile.

Luis Cessa (0-1) lasted only three innings in his first start for the Yankees since last Aug. 14.

ROYALS 5, BREWERS 4: Mike Moustakas’ solo homer opened a five-run seventh inning that snapped an extended run-scoring slump as visiting Kansas City held off Milwaukee in the ninth.

Danny Duffy (4-7) allowed five hits over six effective innings for the Royals, who split a two-game series with the NL Central-leading Brewers.

The Royals then called on Wily Peralta, a former Brewer, to close out the game after Brad Miller hit a three-run homer off reliever Tim Hill with nobody out in the ninth to get the Brewers within 5-4.

Eric Thames struck out before pinch-hitter Erik Kratz singled. Peralta then got Ryan Braun to bounce into a game-ending double play that was upheld on review.

INDIANS 5, CARDINALS 1: Edwin Encarnacion and Lonnie Chisenhall hit back-to-back homers, rookie Shane Bieber pitched six strong innings and Cleveland won at St. Louis.

RANGERS 5, PADRES 2: Mike Minor took a perfect game into the seventh inning, Shin-Soo Choo reached base for the 40th straight game and Texas beat visiting San Diego.

AMERICAN LEAGUE

ASTROS 7, BLUE JAYS 6: Alex Bregman’s two-run homer in the ninth completed a big rally to lift Houston at home.

It was Bregman’s third straight game with a homer and it capped a comeback for the Astros, who trailed 5-0 in the middle of the first inning after a terrible start by Dallas Keuchel.

The Astros trailed by one when Tony Kemp singled off Ryan Tepera (5-3) with no outs in the ninth and advanced to second on a wild pitch. Then with one out in the inning, Bregman sent a fastball to left field, where it bounced off the wall above the Crawford Boxes, to give Houston the victory.

WHITE SOX 6, TWINS 1: Jose Abreu and Avisail Garcia homered for Chicago and James Shields limited Minnesota to four hits over seven innings, leading the White Sox to a win at home.

ATHLETICS 3, TIGERS 0: Jed Lowrie hit an RBI double in the fourth inning and Chris Bassitt pitched six innings, helping Oakland win at Detroit.

The A’s leaned on pitching and defense to win for the ninth time in 11 games.

MARINERS 8, ORIOLES 7: Denard Span hit a tie-breaking sacrifice fly in the 11th inning after Kyle Seager delivered a two-run homer in the ninth, and Seattle won at Baltimore.

NATIONAL LEAGUE

REDS 6, BRAVES 5: Adam Duvall had a two-run single in the seventh inning, Jose Peraza homered and scored twice, and Cincinnati won at Atlanta.

The Reds have won two straight and 9 of 10, taking 2 of 3 from the NL East-leading Braves as closer Raisel Iglesias had a perfect ninth to earn his 15th save in 17 chances.

DIAMONDBACKS 2, MARLINS 1: Robbie Ray pitched six scoreless innings in his first game in nearly two months to help Arizona win at Miami.

Daniel Descalso homered and Deven Marrero knocked in a run for the Diamondbacks, who have won 6 of 7.

Brad Boxberger allowed a home run to Starlin Castro to lead off the ninth and walked the ensuing batter before retiring the next three.

PIRATES 5, METS 3: David Freese hit a go-ahead, two-run single and Pittsburgh rallied for four runs in the ninth inning to win at New York.

Gregory Polanco had an RBI single and Josh Bell added a sacrifice fly in the ninth as the Pirates, shut down by Zack Wheeler most of the night, came back against a beleaguered New York bullpen to win for just the second time in eight games.