Pablo Sandoval hit a two-run double and sacrifice fly to help Barry Zito end a three-start losing streak, and the San Francisco Giants beat the NL West-leading Los Angeles Dodgers 8-0 on Monday night.

Angel Pagan and Hector Sanchez each drove in two runs as the Giants pulled within two games of the Dodgers for their closest position to first place in the division race since April 7.

Zito (6-5), who had allowed 17 runs in 14 1-3 innings for a 10.67 ERA during the skid, defeated the Dodgers for the first time in 10 appearances and nine starts. He was 0-4 since his last win in the rivalry on May 8, 2009.

It didn't start well when he walked leadoff batter Dee Gordon on five pitches. But Elian Herrera grounded into a double play and Andre Ethier also grounded out as the left-hander escaped unscathed.

The Dodgers are 0-for the Bay Area so far after they got swept at Oakland last week. This is their first trip to AT&T Park in 2012.

Melky Cabrera, coming off consecutive hitless games for just the third time this year, singled in each of his first two at-bats, had an RBI and scored two runs as the Giants gave Zito plenty of support.

San Francisco emphatically took the opener to win the first game of a series for the 10th time in its last 12. The Giants have also won 11 of their last 16 versus Los Angeles in their waterfront ballpark.

An impressive way to kick off a challenging stretch with three straight series against clubs that began the week in first place — also Cincinnati and Washington.

Pagan staked Zito to a quick lead with an RBI double against winless Dodgers rookie Nathan Eovaldi aided by a nice bounce off first base. San Francisco got four straight one-out hits off Eovaldi in its four-run first — and the chants of "Beat L.A.!" from the sellout crowd of 42,164 began. Sanchez added an RBI single in the inning, prompting a mound visit from pitching coach Rick Honeycutt.

It marked San Francisco's biggest first inning this season. Sanchez doubled in a run in the fifth.

Zito allowed three hits in seven scoreless innings, struck out four and walked three. Two relievers completed the five-hit shutout, San Francisco's seventh. Los Angeles was blanked for the fourth time and second in seven games.

Eovaldi (0-4) was tagged for a season-high eight runs and 10 hits, stretching his winless stretch to 11 starts since a victory in his major league debut last Aug. 6 at Arizona. The 22-year-old right-hander, making his 12th career start, struck out one and walked one in five innings.

"If he's going to be any good he's going to have to pitch here and in a lot of big situations," manager Don Mattingly said.

Eovaldi retired nine in a row starting with Sandoval's second-inning sacrifice fly before the Giants slugger doubled off the right-field wall in the fifth.

San Francisco skipper Bruce Bochy sat catcher Buster Posey to rest his tender ankle and went with Zito's regular backstop, Sanchez. That means Posey is likely to catch Tim Lincecum in Wednesday afternoon's series finale as the two-time NL Cy Young Award winner (2-8) looks for his first win in 11 starts since winning at San Diego on April 28.

Notes: RHP Brad Penny, signed to a minor league contract May 18, is nearing a promotion as he prepares for his second stint in San Francisco by pitching for Triple-A Fresno. Bochy said the Giants might stretch him out so he's available for a spot start or long relief. "We signed him to come up and help us," Bochy said. "We'd like to stretch him a little bit and keep our options open."... Dodgers GM Ned Colletti, formerly a Giants assistant GM, on San Francisco: "It's become a great baseball city." ... Aubrey Huff, on the Giants' DL since June 15 after he sprained his right knee jumping the dugout rail to celebrate Matt Cain's June 13 perfect game, is close to being able to return. Bochy would like him to do a rehab assignment considering he has missed so much time this season after also spending a stint on the DL with anxiety disorder. ... Reigning NL Cy Young Award winner LHP Clayton Kershaw (5-3) pitches Tuesday night's middle game against Ryan Vogelsong (6-3).