Vogelsong (8-1) struggled through five innings, allowing two runs on seven hits while walking two and fanning three to pick up the victory. He has run his unbeaten streak to 10 straight starts.
Santiago Casilla, Jeremy Affeldt, Sergio Romo and Javier Lopez held the Brewers without a run over a combined three innings and Brian Wilson picked up 30th save as the first-place Giants evened their three-game series with Milwaukee.
Nate Schierholtz went 3-for-4 with a two-run double and Aubrey Huff drove in the tie-breaking run with a fifth-inning sacrifice fly.
The Brewers' Randy Wolf (6-8) was tagged with the loss, allowing three runs on seven hits in a six-inning effort.
Ryan Braun socked a solo homer for Milwaukee, which fell into a first-place tie with St. Louis atop the National League Central.
Benedict Cumberbatch's dramatic reading of R. Kelly lyrics is just what you need
Beyonce flaunts bikini body, Blue Ivy in vacation pics