Updated

Had it been 10 more feet to the right, it wouldn't have cleared the wall.

Scott Van Slyke's game-winning, pinch-hit two-run homer in the bottom of the 11th inning lifted the Los Angeles Dodgers to a 5-3 win over the Arizona Diamondbacks in the middle test of a three-game set.

Mark Ellis slapped a one-out single through the hole on the right side of the infield against Josh Collmenter (4-3) before Van Slyke ripped a hooking, sinking liner that just got into the front row of seats in left.

"That was fun, it was good to get the game over. I got a good ball to hit, it was a changeup down and I was lucky to get the barrel on it," Van Slyke said.

Edinson Volquez, in his second start since being signed by Los Angeles on Aug. 30, surrendered three runs on four hits and a walk over six innings for the Dodgers, who have won two straight on the heels of a four-game slide.

Volquez allowed four runs over four frames in his first start for the Dodgers against the Colorado Rockies last week.

Chris Withrow (3-0), who tossed 1 1/3 perfect innings to pick up the win, was one of five Los Angeles relievers who combined for five shutout innings.

The magic number for the Dodgers to clinch the NL West was reduced to six.

Didi Gregorius smacked a two-run homer for Arizona, which has dropped five in a row to the Dodgers.

"As a team. we're not playing well and our record reflects that," Arizona manager Kirk Gibson said.

RBI groundouts by Volquez and Yasiel Puig in the third staked the Dodgers to a 2-0 lead before Arizona countered with a run in the fourth and two more in the fifth to go in front.

Miguel Montero's two-out RBI single in the fourth got the Diamondbacks on the board and Gregorius' two-run blast gave Arizona a 3-2 edge in the fifth.

Andre Ethier's two-out RBI double in the home fifth tied it.

Game Notes

The Dodgers were 2-for-10 with runners in scoring position, while Arizona finished 1-for-3 with RISP ... Puig tallied his 11th stolen base of the season.