With the loss, the Phillies' magic number of wins or Atlanta Braves losses needed to clinch the NL East remained stuck at four. The Braves didn't cooperate earlier in the day, beating Washington 11-5.
Trevor Hoffman (2-2) pitched a scoreless ninth to pick up the win for Milwaukee.
With the game tied at 5 and Walker in to pitch the ninth for Philadelphia, Craig Counsell led off with a sharp single. Braun then clubbed a pitch deep to right-center field and was mobbed by teammates as he crossed home plate.
Ryan Howard hit his 43rd home run for the Phillies.
In a sloppy performance highlighted by a pair of errors for each team, it got particularly messy in the sixth as the Brewers rallied for two runs to tie the game at 5.
After a two-out walk to pinch hitter Jason Bourgeois and bloop ground-rule double by Felipe Lopez, Counsell hit a flare that caused confusion in the middle of the Phillies' outfield and eventually bounced off of shortstop Jimmy Rollins. The play originally was ruled an error but was later changed to a two-RBI hit.
The play erased a 5-3 lead the Phillies took on Howard's homer.
It was Howard's fifth home run in nine career at-bats against Brewers starter Braden Looper, who came into Saturday night's game having allowed the most home runs in the major leagues - then gave up two more to run his season total to 39. Even light-hitting catcher Paul Bako got in on the action with a two-run shot in the second inning.
The Phillies then ran their lead to 4-0 in the third on Jayson Werth's sacrifice fly and a bloop RBI single by Pedro Feliz.
Braun's RBI single and a sacrifice fly by Prince Fielder cut the lead to 4-2 in the third, and Milwaukee added another run on a groundout by Lopez in the fourth. But Howard homered to lead off the fifth and put the Phillies up 5-3.
Kyle Kendrick started in place of Pedro Martinez, who was scratched because of continued soreness in his neck after hurting himself during an at-bat a week ago.
Phillies manager Charlie Manuel said before Saturday's game that was not clear when Martinez would return. His next scheduled appearance is against Houston on Thursday.
Kendrick went four innings, giving up six hits and three runs. NOTES: Saturday's announced crowd of 40,141 put the Brewers over 3 million in attendance for the second year in a row. ... Macha said LHP Manny Parra, who made a successful return from recent neck spasms to win Friday's game, would start Thursday's game in Colorado. ... Raul Ibanez robbed Hardy with an over-the-shoulder catch at the warning track in the second inning.