PHOENIX — Matt Cain is starting to find his groove.

PHOENIX — Matt Cain is starting to find his groove.

The San Francisco righty allowed one run and struck out four in three innings as the Giants beat the Milwaukee Brewers 6-1 on Sunday,

"I had some pretty good movement. I was in pretty much every situation, had guys on and worked out of the windup. But everything was good," Cain said.

Cain's results this spring have been a far cry than those posted last season, when he went 16-5 with a 2.79 ERA and threw a perfect game.

In three previous exhibition outings spanning seven innings, he had allowed nine runs — five earned — on 13 hits with only three strikeouts. But against the Brewers, Cain matched his spring strikeout total eight batters into the game.

Cain pitched into trouble in the fourth after striking out Brewers starter Chris Narveson looking. Norichika Aoki and Scooter Gennett singled and Carlos Gomez walked.

Aoki scored on a sacrifice fly by Alex Gonzalez and Cain ended the inning by retiring Bobby Crosby on a fly ball to deep center. Cain had been scheduled to throw four innings, but a little stomach upset limited him to three.

"My stomach was a little bit funky this morning so they just wanted to get things going," Cain said. "I might have gone another inning or so but for the little tummy ache issue. Something just didn't agree."

Brett Pill, Cole Gillespie and Nick Noonan had RBI singles for the Giants.

Narveson made his second official appearance and third overall — he started against Team Canada in a World Baseball Classic exhibition Tuesday — and gave up two runs and five hits in three innings.