PHOENIX, Ariz. -- The San Francisco Giants ended their four-game Cactus League losing streak Sunday, grabbing an immediate lead and holding on for a 6-1 triumph over the Milwaukee Brewers.

Cole Gillespie rapped a pair of singles to lead the Giants' offense.

Both starters worked three innings. San Francisco ace Matt Cain yielded one run and four hits with four strikeouts, while Milwaukee's Chris Narveson allowed two runs and five hits.

Cain might have worked one more inning but was nagged by a mildly upset stomach. With nearly three weeks of spring games remaining, Giants manager Bruce Bochy felt no need to push his Opening Day starter.

"We're in a position where we can cut back, so we did it today," Bochy said.

The Giants jumped ahead with a pair of first-inning runs. Kensuke Tanaka laid down a bunt single to begin the rally with one out. Consecutive two-out singles from Hector Sanchez, Brett Pill and Gillespie generated the scoring.

Milwaukee split the difference in the third. With one out, Norichika Aoki and Scooter Gennett singled and Carlos Gomez walked to load the bases, setting up Alex Gonzalez's sacrifice fly.

Gomez kept up his hot streak in Cactus League play, going 2-for-2 in the game and increasing his batting average to .533.

Gregor Blanco manufactured a run for San Francisco in the fifth. He beat out an infield single, stole second base and dashed to third as Tanaka struck out on a wild pitch. That drew a throw to third baseman Gonzalez from catcher Robinzon Diaz. Blanco, who already had turned for home, slid in safely on Gonzalez's throwing error.

The lead widened to 5-1 in the sixth. Sanchez walked, Pill reached base safely on a fielding error and Gillespie singled to load the bases with nobody out. Nick Noonan grounded an RBI single, ending reliever Jed Bradley's afternoon. Rob Wooten replaced Bradley and coaxed Wilson Valdez's double-play grounder, which scored Pill.

The Giants tacked on their final run when Valdez came home on an error by Gennett in the ninth.

Brewers up next: The short-handed Brewers, with several top players away with their respective World Baseball Classic teams, host the Los Angeles Dodgers Monday in Spring Training action at Maryvale Baseball Park at 3:05 p.m CT. Rickie Weeks should be back in the lineup for Milwaukee, and right-hander Mike Fiers gets the start on the mound.