LOS ANGELES -- Paul Goldschmidt homered after Yasmany Tomas and Aaron Hill gave the Diamondbacks the lead with longballs off Brett Anderson, and Arizona beat the Los Angeles Dodgers 8-4 Monday night.
The Dodgers' loss in the opener of this four-game series kept their magic number for clinching a third straight NL West title at seven, with second-place San Francisco idle.
Jhoulys Chacin (1-1) allowed two runs, six hits and four walks over 5 1/3 innings in his fourth start for the Diamondbacks, one day after they were mathematically eliminated from postseason contention. The seven-year veteran right-hander posted his first win in the majors since June 12, 2014, with Colorado.
The Diamondbacks' bullpen came up big in the sixth after Chacin walked two batters and was pulled with one out. Andrew Chafin struck out pinch-hitter Scott Van Slyke and David Hernandez fanned pinch-hitter Scott Schebler.
Goldschmidt made it 6-2 in the eighth with his 29th homer, a line drive off the left field pole against Joel Peralta.
Yasmani Grandal cut the margin to 6-4 in the bottom half with his career-high 16th homer, a two-run shot off Matt Reynolds. But David Peralta helped Arizona put it away with a two-run single in the ninth against Ian Thomas.
Anderson (9-9) gave up five runs and 10 hits in 4 2/3 innings. The left-hander's 17 home runs allowed are the most on the Dodgers' staff.
Chacin escaped a bases-loaded jam in the second by retiring Howie Kendrick on a flyball. A.J. Pollock got the Diamondbacks on the board in the third with a sacrifice fly, and they tied it 2-all when Tomas lined Anderson's first pitch of the fourth inning to left-center for his ninth home run.
The Diamondbacks scored three more runs in the fifth, extending their lead to 5-2. Anderson yielded four consecutive hits with none out, including Hill's sixth homer and Welington Castillo's RBI single.
Chacin gave up four consecutive two-out hits in the first inning, starting with Adrian Gonzalez's 28th homer and ending with rookie Corey Seager's RBI double inside first base.
Seager became the first Dodger to reach base with a hit or a walk in each of the first 16 big league games he started since Jim Gilliam in 1953 (24 straight). The 21-year-old shortstop, who was the 18th overall pick in the 2012 draft, is 23 for 61 with 11 RBIs, eight doubles and a home run.
Diamondbacks: LHP Robbie Ray (4-12) is 1-8 with a 4.99 ERA over his last 12 starts. The only win during that stretch was against the Dodgers at Chase Field on Sept. 11, a 12-4 rout.
Dodgers: LHP Alex Wood (11-10) will get a rematch against Ray. He is coming off a 2-0 home win against Colorado last Wednesday, when he gave up just one hit and no walks in eight innings while throwing only 78 pitches.