SAN FRANCISCO (AP) -- The San Francisco Giants were on a roll with a chance to move into the top spot in the NL West for the first time in two months.
Wily Peralta returned from the disabled list and shut them down while pitching for the first time in two months, leading the Milwaukee Brewers past the Giants 5-2 on Tuesday night to snap a three-game losing streak and seven-game skid to San Francisco.
Not that Bruce Bochy is counting or checking the standings in late July.
"It doesn't matter where you're at right now, to be honest," the Giants manager said. "It's a little early to be doing that. It's all about going out there, playing well and winning ballgames. It's pretty simple at this stage. There's a lot of baseball left. ... We've been through this so I know these guys aren't looking at the standings."
They also have won three World Series titles in the past five years despite plenty of ups and downs along the way.
Peralta (2-5) retired the initial six batters on the way to his first win since May 6, outpitching Matt Cain (2-2) as the Brewers also ended a seven-game skid to San Francisco -- matching the longest in the series.
Peralta allowed both runs and five hits in six-plus innings, struck out three and walked two in his first start since May 22 after being sidelined with a strained left oblique. Francisco Rodriguez finished for his 23rd save in Milwaukee's first win in the last six meetings at AT&T Park.
Cain, too, has had a slow start to the season after missing the first three months of the year with a strained flexor tendon in his pitching arm.
He gave up four runs and eight hits in six innings making his fifth start. He dropped to 0-3 over his last four home starts against Milwaukee but hadn't faced the Brewers at AT&T Park since 2013.
"Today wasn't terrible. I made some pitches that caught the middle part of the plate and they took advantage of them," Cain said. "I didn't make the adjustment to get it off the middle of the plate. Then when I did it was already three or four runs down."
The defending World Series champion Giants, 9-2 since the All-Star break, lost for only the second time in 14 games with a chance to go a season-best 12 games over .500.
With the first-place Dodgers losing at home to Oakland, the Giants missed a chance to take the NL West lead for the first time since May 29 and instead remained a half-game back.
Milwaukee got plenty of contributions from throughout the order on a night slugger Ryan Braun missed his second straight game because of back spasms that came on during pregame warmups Monday and forced a late lineup scratch.
Carlos Gomez hit an RBI double a day after being ejected and Adam Lind singled in a run and hit a sacrifice fly after missing two games with a tight back as Milwaukee ended the Giants' seven-game home winning streak and six straight overall. Jonathan Lucroy hit a sacrifice fly, while leadoff hitter Gerardo Parra tripled, doubled, singled and scored three runs. He has a 12-game hitting streak, longest by a Brewers player this year.
"Offensively also it was a very good game for us,," Brewers manager Craig Counsell said.