SAN FRANCISCO -- Jeff Francoeur knew he had to change something in his hitting after a futile start to the last road trip. With the help of Giants coaches, he adjusted his batting stance and saw immediate results.
"I made quite a few adjustments," Francoeur said. "I basically went back to my toe-tapping, something I was doing with Atlanta and got away from in Kansas City. I felt good going to the plate tonight."
Brandon Belt had three hits for the Giants, who won their fourth in six games. Hunter Pence walked three times and stole two bases.
"I just try to have good at bats and that's what happened," said Pence, who walked a total of three times in his previous 30 games combined. "The game dictates itself."
Santiago Casilla (5-2) pitched the eighth for the victory, while John Axford (4-5) took the loss. Sergio Romo pitched the ninth for his 27th save in 31 chances.
Juan Francisco hit a home run and drove in two for the Brewers, who have lost four of five. Jean Segura and Jonathan Lucroy each had two hits.
"We had opportunities and we didn't come through," Brewers manager Ron Roenicke said. "There were a couple of missed calls that hurt us and they got a couple of breaks."
Giants starter Chad Gaudin gave up a run on four hits over 6 1/3 innings. He walked four and struck out eight.
Brewers starter Tyler Thornburg went six innings, allowing an unearned run on seven hits. He walked two and struck out four. Thornburg has allowed one earned run on the road through his first five major-league appearances, a span of 21 innings.
He's mostly upset about missing a squeeze bunt in the third that would have put Milwaukee ahead.
"Definitely the bunt," Thornburg said. "That's something I am going to think about all night even though I will try to flush it. I hit in college and it's something I pride myself on to get runs for myself. It was buntable."
The Giants had runners in scoring position in each of the first four innings and were 0 for 9 in those situations. They were 1 for 13 overall.
"We didn't get anything going until the last inning," Giants manager Bruce Bochy said. "We needed something."
In the fourth, Belt and Roger Kieschnick each singled to start the inning. Gregor Blanco followed with a sharp grounder to Francisco at first, who threw the ball into left field trying for the out at second. That allowed Belt to score and give the Giants a 1-0 lead.
The Brewers evened things in the seventh, with Francisco's ground-rule double driving in a run.
In the eighth, Axford walked Pence, who stole second, to start the inning. After Buster Posey hit a deep drive to centerfield, Axford walked Pablo Sandoval intentionally, throwing wildly on the fourth ball to allow Pence to reach third.
"I've had success with Pence in the past," Axford said. "You never want to put the first runner on in a tight ballgame like that."
Rob Wooten came in to pitch and walked Belt to load the bases. He was replaced by Michael Gonzalez, who gave up Francoeur's go-ahead hit. Jeff Bianchi mishandled Blanco's grounder, allowing two more runs to score.
Javier Lopez got pinch hitter Rickie Weeks to ground into a double play with the bases loaded in the seventh to preserve the tie.
"Javy saved us," Bochy said. "It was a tough spot to put him in and you can't ask for a bigger double play, especially late in the game."
Francisco added a solo shot in the ninth.
Brewers IF Aramis Ramirez (left patellar tendinitis) ran the bases and will do so again on Wednesday. He will then be reevaluated and could join the team in Seattle this weekend. ... Brewers RHP Yovani Gallardo (left hamstring strain) will play long toss in the next few days after reporting some tightness following his long toss session on Saturday. ... Brewers RHP Brandon Kintzler has not allowed a run in his last 12 outings, a span of 15 innings. ... RHP Wily Peralta (7-11, 4.57) will start for the Brewers on Tuesday. He's lost his last two starts. ... RHP Matt Cain (7-6, 4.57) makes the start for the Giants Tuesday. He's 3-6 in 10 starts against the Brewers. ... Giants IF Marco Scutaro made his first start as a leadoff hitter since last Aug. 2. ... Giants RHP Ryan Vogelsong is scheduled to start Friday's game against the Baltimore Orioles. It will be his first start breaking a finger on May 20. ... RHP Guillermo Moscoso will be moved to the bullpen to make way for Vogelsong in the rotation. ... Pence became the first Giants player to walk three times and steal two bases in a game since Jose Cruz did it in April of 2003.