PHILADELPHIA — In October, the Phillies will be watching the Dodgers play meaningful games. For now, they're going in opposite directions.

Aaron Altherr hit a tiebreaking, two-run single in the eighth after launching a tying, two-run homer an inning earlier and Philadelphia beat slumping Los Angeles 7-5 Wednesday night.

The Dodgers have lost four straight and 20 of 25. Their magic number to clinch a fifth straight NL West title remained at two when Arizona beat San Diego in a late game, so they'll have to wait until at least Friday to wrap up the division crown. Los Angeles could have done it Wednesday with a win and a Diamondbacks loss.

"Give credit to them," Dodgers manager Dave Roberts said about the Phillies. "They're really competing."

The Phillies have won eight of 10 and are 32-33 since the All-Star break, climbing out of last place in the majors. They'll try to complete a four-game sweep Thursday afternoon.

"Wins like this against good teams help our confidence," Altherr said. "I'm excited for our future."

Luis Avilan (2-3) walked Cesar Hernandez to start the bottom of the eighth. Freddy Galvis bunted and catcher Austin Barnes made a wild throw to second base for an error that allowed the runners to reach second and third. Odubel Herrera struck out and Rhys Hoskins was intentionally walked. Brandon Morrow entered and Altherr ripped a hit off the right-field fence.

Earlier in the series, Altherr became the first major leaguer to hit a grand slam off Clayton Kershaw. The outfielder has gone deep in three straight games.

"I'm just seeing the ball really well, got my timing back and I'm a lot more relaxed at the plate," Altherr said.

Luis Garcia (2-4) got the win despite allowing a run in the eighth. Hector Neris finished for his 23rd save in 26 chances. Herrera made a leaping catch in centre field to end it, robbing Yasiel Puig.

"They're a playoff team so for everyone in this clubhouse it's great," Herrera said through a translator. "We all get motivated when we win games against real good teams like them."

After Cody Bellinger ripped a two-run double to give the Dodgers a 4-2 lead in the top of the seventh, the Phillies answered against reliever Ross Stripling.

Hoskins led off with a walk and Altherr followed with a two-run homer to deep left. One out later, Tommy Joseph connected for a 5-4 lead. But Los Angeles tied it at 5 on a walk, wild pitch, passed ball and fielder's choice grounder.

The Phillies jumped ahead 2-0 in the second. Altherr lined a single and scored when Joseph ripped a double down the left-field line. Andrew Knapp followed with an RBI single.

Chris Taylor cut it to 2-1 when he hit his 21st homer the opposite way to right in the third.

"We're really grinding right now," Dodgers starting pitcher Alex Wood said.

CHASING APPRECIATION

Chase Utley, among the most beloved players in Phillies history, got another standing ovation when he came to the plate as a pinch-hitter for the Dodgers leading off the seventh. Fans cheered after he lined a triple to centre off Victor Arano. Utley also hit the grounder that scored the tying run in the eighth.

STARTING TIME

Dodgers: Wood gave up two runs and three hits, striking out six in six innings.

Phillies: Jake Thompson allowed one run and three hits in five innings.

UP NEXT

RHP Kenta Maeda (12-6, 4.21 ERA) takes the mound for the Dodgers while RHP Mark Leiter Jr. (3-6, 4.93) goes for the Phillies in the series finale Thursday. Maeda is 3-0 with 21 strikeouts in three career starts vs. Philadelphia. Leiter tossed one scoreless inning the only time he faced Los Angeles.

___

More AP baseball: https://apnews.com/tag/MLBbaseball