UNDATED (AP) — Javier Báez hit a tiebreaking homer in the eighth inning after scoring on a nifty slide in the second, and the New York Mets snapped a three-game losing streak with a 5-3 victory over the Miami Marlins. The Mets, who had lost five of six, let an early 3-0 lead slip away but recovered to maintain their 1 1/2-game lead in the NL East over surging Philadelphia.
Báez, acquired in a trade-deadline deal with the Chicago Cubs last Friday, put New York back in front 4-3 with an opposite-field drive off Anthony Bass. It was his 24th home run this season and second with his new team — Báez has homered in both Mets wins since the trade.
The Philadelphia Phillies extended their winning streak to four games with a 9-5 win over the Washington Nationals. Philadelphia is 55-53 and two games over .500 for the first time since July 18, when it was 47-45. Rhys Hoskins also homered and drove in three runs, Didi Gregorius hit a two-run homer and the Phillies turned an early 3-0 deficit into an easy win. Luis García homered twice for the Nationals. Philadelphia goes for a four-game sweep Thursday.
Elsewhere in the majors:
— Kevin Gausman threw six stellar innings, Alex Dickerson added a three-run homer and the San Francisco Giants beat the Arizona Diamondbacks 7-1 on Wednesday night. Gausman gave up five hits, walked none and struck out eight. He cruised through the first five innings before running into trouble in the sixth. Asdrúbal Cabrera tagged Gausman for an RBI single, but then the hard-throwing right-hander retired Drew Ellis and Daulton Varsho to end the threat.
— Max Scherzer struck out 10 in his Dodgers debut and got plenty of offensive support as Los Angeles hit four home runs to defeat the Houston Astros 7-5, capping a contentious two-game series at Dodger Stadium. Mookie Betts homered twice, while Will Smith and AJ Pollock also went deep off Houston starter Jake Odorizzi. Michael Brantley, Carlos Correa and Kyle Tucker connected for Houston.
— Patrick Wisdom hit a three-run double to back a solid outing from Alec Mills and lead the Chicago Cubs past the Colorado Rockies 3-2. Mills overcame a rocky start to pitch six innings and earn his first win since July 7, and Wisdom finished with three hits. Manuel Rodriguez gave up a two-out single in the ninth but got Sam Hilliard on a comebacker to pick up his first career save. Raimel Tapia had two doubles and nearly made a run-saving catch in the sixth for Colorado.
— Adam Duvall and Jorge Soler homered and Stephen Vogt drove in the eventual game-winning run with a sacrifice fly, helping the Atlanta Braves to a 7-4 victory over the St. Louis Cardinals. Dansby Swanson went 4 for 4 with three runs scored for the Braves, who moved to .500 at 54-54. Will Smith, the sixth Braves’ pitcher, picked up his 22nd save with a 1-2-3 ninth. The win helped Atlanta post its first two-game winning streak since the All-Star break. The Braves have won eight of their last nine games at Busch Stadium. Giovanny Gallegos (5-4) allowed three runs in the eighth inning as the Cardinals lost for the sixth time in 10 games.
— Salvador Pérez hit a two-run homer and the Kansas City Royals went deep four times to beat the Chicago White Sox 9-1. Kansas City ended a four-game losing streak, while the AL Central-leading White Sox lost for the eighth time in 13 games. Royals starter Carlos Hernández yielded only two hits over five innings in beating the White Sox for the second time in seven days. Hernández has allowed six hits while striking out 10 in his last 11 innings against Chicago. Pérez launched his 27th homer in the third, tying his career high.
— Recently acquired Anthony Rizzo homered again, DJ LeMahieu drove in four runs and the New York Yankees cruised to a 10-3 win over the Baltimore Orioles. Rizzo’s solo homer in the fourth inning made him the first player in Yankees history with at least one RBI in each of his first six games with the club. LeMahieu had three hits and Giancarlo Stanton drove in three runs for the Yankees.
— Shohei Ohtani pitched six solid innings, Juan Lagares raced home from second base on a wild pitch for the lead with the two-way standout at the plate, and the Los Angeles Angels beat the Texas Rangers 2-1. Jack Mayfield went 3 for 3 while homering from the No. 9 spot for the second consecutive night. Ohtani allowed four hits and struck out six for the Japanese star’s third win in four outings.
— George Springer had four hits, including the 42nd leadoff home run of his career, and Steven Matz pitched six shutout innings as the Toronto Blue Jays beat the Cleveland Indians 8-6. Springer homered on J.C. Mejia’s first pitch. He singled and scored in the second, hit a two-run double in the third and singled again in the fifth. Needing a triple to complete the cycle, Springer flied out in the eighth. The Blue Jays have hit 163 home runs this season. Toronto began the day tied with San Francisco for the major league lead.
— Matt Olson hit a two-run, walk-off double in the 10th inning and the Oakland Athletics rallied past the San Diego Padres 5-4. The A’s scored twice in the ninth with two outs off closer Mark Melancon to tie it at 3. After San Diego scored a run in the top of the 10th off Lou Trivino to take a 4-3 lead, Olson came to the plate with runners on the corners and no outs. Olson laced the first pitch he saw from Tim Hill off the right field wall, scoring Mark Canha and Starling Marte, and sending the Oakland Coliseum into a frenzy. The A’s posted their AL-leading ninth walk-off win of the season.
— Eduardo Rodriguez struck out 10 in five shutout innings and the Boston Red Sox snapped a five-game losing streak with a 4-1 win over the Detroit Tigers. Rodriguez allowed two hits and four walks in helping Boston end its longest losing streak of the season. J.D. Martinez, Enrique Hernandez and Jarren Duran homered for the Red Sox. Boston pitchers struck out 18 batters, with Matt Barnes getting two as he pitched a perfect ninth for his 24th save in 28 chances. Casey Mize gave up four runs on seven hits and a walk in five innings. He struck out three and allowed all three Boston homers.
— Randy Arozarena had a two-run triple during a three-run third and the AL East-leading Tampa Bay Rays beat the Seattle Mariners 4-3 to avoid a season series sweep. The Rays went 1-6 overall against Seattle and lost the first two games of the three-game set. Josh Fleming allowed two runs and five hits, and Mike Zunino hit his 21st homer for the Rays. Mariners rookie Logan Gilbert gave up three runs and four hits over five innings. Seattle had won 11 consecutive games, dating to May 25, when Gilbert started. The right-hander was 5-0 during the stretch.
— Pinch-hitter Rowdy Tellez launched a three-run homer with two outs in the seventh inning to put the Milwaukee Brewers ahead for good in a 4-2 victory over the Pittsburgh Pirates. Devin Williams worked around a leadoff walk in the ninth to earn his first career save. Pittsburgh’s Bryan Reynolds went 2 of 2, walked twice and scored both of the Pirates’ runs. The Brewers won two of three from the Pirates and remained 7 1/2 games ahead of Cincinnati in the NL Central.
— Luis Castillo pitched six effective innings, Tyler Stephenson homered to give the Reds a cushion they ended up needing, and Cincinnati held on to beat the Minnesota Twins 6-5. Jonathan India had three hits and Joey Votto drove in two runs for the Reds, who came in trailing first-place Milwaukee by 7 1/2 games in the NL Central. Castillo allowed Jorge Polanco’s first-inning solo homer but settled in nicely from there. Stephenson went deep in the seventh to give the Reds a 6-1 lead. The Twins rallied with four runs in the eighth before Michael Lorenzen came in for a five-out save.