SAN FRANCISCO (AP) Rubby De La Rosa pitched into the sixth inning to outduel Madison Bumgarner, and the Arizona Diamondbacks beat the San Francisco Giants 2-0 on Friday night.

A.J. Pollock had two hits and made a stellar defensive play in the eighth to help preserve the Diamondbacks' 10th shutout of the season. Paul Goldschmidt also had two hits and scored a run as Arizona got its fifth consecutive win at AT&T Park.

De La Rosa (13-8) allowed only one hit over 5 2/3 innings to beat the Giants for the third time this season. He walked four and struck out five before leaving with the bases loaded in the sixth.

More from FoxSports

Bumgarner (18-8) gave up only one earned run in eight innings but was denied in his bid to join Jake Arrieta of the Chicago Cubs as baseball's only 19-game winners this season.

The Giants dropped 8 1/2 games behind the Dodgers in the NL West with 15 to play. Los Angeles' magic number to win the division is now eight.

De La Rosa faced only two over the minimum through five innings before loading the bases with two outs in the sixth. Reliever Andrew Chafin retired Brandon Belt on a grounder to end the threat.

Brad Ziegler pitched the ninth for his 27th save.

The win preserved the Diamondbacks' slim playoff hopes, although they would have to go 15-0 the rest of the way while hoping the Dodgers lose all of their remaining games. Arizona was eliminated from the wild-card contention earlier in the day when the Chicago Cubs beat St. Louis.

Bumgarner beat the Diamondbacks twice this season and pitched in and out of two jams early before running into trouble in the sixth.

Pollock, who led off the game with a single, opened the inning with his second hit off Bumgarner. One batter later, Goldschmidt lined a double down the left-field line. The ball rolled and glanced off the glove of Alejandro De Aza for an error, allowing Pollock to easily score from first.

Welington Castillo followed with an unusual 6-2-3 RBI groundout to make it 2-0.

Pollock also made a sparkling defensive gem in center field during the eighth when he leaped and robbed pinch-hitter Jarrett Parker of a home run.

Bumgarner, who had won his seven previous starts at home, gave up five hits, struck out seven and walked three.

TRAINER'S ROOM

Giants: Brandon Crawford was back at shortstop after missing seven games with calf and side injuries. Crawford batted seventh and went 0-for-3. . RHP Tim Hudson, who has been bothered lately by a troublesome hip, threw a bullpen session before the game and told reporters he should be able to make his next scheduled start in the series finale Sunday.

UP NEXT

Diamondbacks: LHP Patrick Corbin (5-4) has a 1.85 ERA over his four previous outings and will be making his first start at AT&T Park since Sept. 6, 2013.

Giants: RHP Mike Leake (10-8) earned his first win with San Francisco in his previous start and is attempting to win consecutive games for the first time since July.