Blum hit a three-run homer in the sixth and an RBI single in the ninth for Houston, which managed to get the win despite a shaky start by Roy Oswalt. Lance Berkman walked twice and scored three times.
"Huge," Blum said. "Huge. Any win right now is huge. We have been in such a funk for so long it feels like we couldn't catch a break on anything."
Houston had lost five of six and is 7-15 since moving to 50-46 on July 24.
"This was a good win for us," manager Cecil Cooper said. "A couple of big, big swings were the difference in the game. You can't minimize Blum's home run, and you definitely can't take away Hunter's. That was pretty dramatic."
The loss ended Milwaukee's three-game winning streak -- its longest since June -- and denied the Brewers (58-59) a chance to climb above .500 for the first time since July 25. The Brewers last won four in a row when they won seven straight from May 12-19.
Prince Fielder became the first Brewers player to record three consecutive seasons with at least 30 homers and 100 RBIs when he hit a long two-run shot in the sixth to give Milwaukee a 5-4 lead.
Houston responded with three runs in the eighth. Berkman led off with a walk against David Weathers (3-4) and scored on Pence's two-out, opposite-field drive to right, his 18th of the season. Ivan Rodriguez walked, moved up on Jeff Keppinger's base hit and scored on Jason Michaels' pinch-hit single.
The game ended when Pence made a leaping catch just shy of the right-field wall on a long drive by Fielder with two runners on.
"I thought it was out," Cooper said. "I just turned to walk down to sit down. I said, 'Tie score.' I thought the ball was out of the ballpark. Sheez. You can't let that guy beat you."
Both starters struggled. Milwaukee's Braden Looper gave up four runs and four hits in six innings, and Oswalt yielded five runs and eight hits over six innings in his second consecutive rough outing.
Looper leads the National League with 30 home runs allowed.
"That does have to change," Brewers manager Ken Macha said. "That means we need to score when he's pitching. When he gets up in the zone, they don't miss it a whole lot."
Blum's ninth homer, his seventh since the All-Star break, gave Houston a 4-2 lead. And it could have been worse for Looper. Pence, who followed Blum, had what appeared to be a long home run down the left-field line overturned on replay.
"It's just nice to win," Pence said. "We found a way to get a win. We're running out of time, and we have to get hot here quickly. That's the bottom line."
Fielder's drive off the batter's eye below the Miller Lite sign in center field keyed Milwaukee's three-run sixth. His 30th homer gave him 105 RBIs.
And he knows No. 31 would have tied the game.
"I wish I would have saved some for the last one, I guess," he said.
Ryan Braun hit a two-run homer in the first for Milwaukee. It was his 26th of the season and fourth in the last four games.
"Two pitches cost me four runs," said Oswalt, who was making his second start since leaving a game on July 28 with a lower back strain. "Other than that, I felt pretty good. This is the first time since coming off the back injury I actually felt pretty decent."
Brewers 2B Felipe Lopez had three hits for the third straight game and has an 11-game hitting streak. ... Brewers RHP Jeff Suppan, on the disabled list since July 30 with a left oblique strain, will make a rehab start on Thursday for Triple-A Nashville and is expected to start August 25 against Cincinnati. RHP Dave Bush (triceps) will make a rehab start Tuesday for Class A Wisconsin and Saturday for Double-A Huntsville, the team said. ... Keppinger started in place of SS Miguel Tejada, stuck in an 0-for-15 rut.