"My confidence never wavered," said Braun, a three-time All-Star who was in an 0-for-19 skid before his sixth-inning single. "I was obviously extremely frustrated."
After Braun drove the winning hit off the base of the right-field wall, jubilant teammate Prince Fielder picked up his fellow slugger in a bear hug at second.
"My teammates, coaches, fans, everybody has been so supportive, and I really appreciate that," Braun said. "Confidence was never an issue, but it was obviously the toughest stretch I've ever gone through, individually. That, combined with the tough stretch for the team, it really wasn't fun. It's nice to have an emotional win."
Milwaukee tied it at 4 in the ninth on George Kottaras' RBI triple off Octavio Dotel, who blew his fourth save in 23 chances. The Pirates have lost four consecutive games and 22 of their last 24 on the road.
Pinch-hitter Jim Edmonds singled leading off the 10th against Evan Meek (4-3), the Pirates' NL All-Star representative. Dave Bush, slated to be the Brewers' starter Saturday night, pinch-ran and was erased on Weeks' fielder's choice groundout.
Weeks then stole second. Corey Hart struck out and Fielder was intentionally walked.
Braun hit the first pitch from Meek, who came into the game with a 0.94 ERA in 48 innings.
"Our No. 1 priority with Braun was just to keep the ball down and it was a bad pitch," Meek said. "It was a breaking ball up, right where he was looking to hit it and that's really it. It was a poor pitch. Bad location. The ball was up and he did what he should have done to it."
Weeks scored without a play.
"Braun, he's the type of guy that's not going to back down and not going to give up any at-bats," Weeks said. "Of course, everybody is pulling for him and he came up with the big hit."
Milwaukee closer John Axford (4-1) pitched a scoreless 10th for the win.
With the infield in, Kottaras' liner down the line got by first baseman Garrett Jones for a tying triple. Kottaras tried to score when Dotel's pitch to Alcides Escobar bounced away from Doumit, but his throw to Dotel at the plate was in time to get Kottaras and keep the score tied.
Escobar struck out, sending the game into extra innings.
In the top of the 10th, Jones singled, moved to second on a groundout and third on a wild pitch with only one out. Axford then struck out Pedro Alvarez and Doumit to end the threat.
Pittsburgh starter Paul Maholm pitched seven innings, giving up two runs and three hits. He also hit three batters with pitches.
Milwaukee starter Doug Davis, making his first appearance after missing two months with inflammation of the lining around his heart, pitched five innings, giving up four runs and seven hits.
Brewers All-Star right-hander Yovani Gallardo played long toss for the first time since sustaining his oblique injury on Sunday, and manager Ken Macha said Gallardo felt good afterward. Gallardo is on the disabled list and will miss the All-Star game. ... Pittsburgh assistant pitching coach Ray Searage lost a ball in the sun while playing catch with Dotel during batting practice and was struck in the face but was not seriously injured. He was in the dugout during the game. ... Brewers right-hander LaTroy Hawkins will pitch a simulated game Saturday. He has been on the DL since early May with right shoulder weakness. ... Ex-Milwaukee outfielder Geoff Jenkins signed a contract valued at a dollar and retired as a member of the Brewers on Friday. He played for Milwaukee from 1998 to 2007 and is second on the team's career HR list. ... The Pirates signed three draft choices: right-handers Kevin Kleis (27th round), Bryton Trepagnier (41st round) and Logan Pevny (49th round).