Weeks, who has been relegated to a bench role but replaced Ray Durham after the sixth, drove reliever Chad Gaudin's pitch deep to left field, flipping his bat as his shot cleared the wall to score McClung and Mike Cameron.
The win eliminated the Astros even though Houston beat Atlanta 5-4.
Corey Hart added a two-out run-scoring single in the sixth and Jason Kendall a two-out RBI double in the second to put the Brewers back on top of a race they seemed likely to win at the start of September, when they led the wild-card race by 5 1/2 games.
But Milwaukee dropped 15 of 19 to begin the regular season's final month. Manager Ned Yost was fired and replaced with Dale Sveum, leaving the Brewers in a desperate scramble to reach the postseason for the first time since 1982.
Now Milwaukee is a win away from at least a spot in a play-in game, but the Brewers would have to go on the road in every tiebreaker scenario and would rather just keep beating the Cubs.
They did on Friday night with McClung's stellar work out of the bullpen.
With the game tied at 1 in the sixth, Cubs reliever Sean Marshall (3-5) allowed a leadoff double to Durham and walked Ryan Braun before striking out Prince Fielder. Jeff Samardzija came in and got J.J. Hardy to pop up for the second out, but Hart flared a go-ahead RBI single to left, his second of the game after coming in hitting .172 in September.
In the seventh, backup catcher Koyie Hill was called for catcher's interference during McClung's at-bat. McClung reached second on a balk and moved to third on Cameron's single before Weeks' shot off Gaudin made it 5-1.
The Brewers got yet another victory despite a shaky starting rotation that's held up to every move Sveum's made. The next risk comes Saturday, when All-Star Ben Sheets (sore elbow) starts for the first time since Sept. 17.
Brewers starter Jeff Suppan, 0-3 with a 10.47 ERA in his first four September starts, allowed eight hits and a walk over five innings. McClung (6-6) did the rest, striking out six and retiring 10 of the final 11 Cubs.
Suppan's lone mistake was a belt-high pitch to Jim Edmonds in the second that Edmonds launched in the Brewers' bullpen to give the Cubs a 1-0 lead. But Kendall tied it in the bottom of the second with his RBI double, scoring Hart.