Jim Edmonds began the Brewers' winning rally with a ground-rule double off Octavio Dotel (2-2), and two batters later Hart blasted a pitch for his 21st homer of the season, allowing Milwaukee to sweep a three-game series from the Pirates going into the All-Star break.
The game-winner came after Pittsburgh took a 5-4 lead in the top of the ninth when Andrew McCutchen's sacrifice fly scored Ronny Cedeno.
Ryan Braun was 2-for-3 with a homer and two runs scored for Milwaukee.
The Brewers sport a 40-49 record entering the break.
Copyright 2010 United Press International, Inc. (UPI).