Bryan LaHair hit a two-run, pinch-hit home run for a 3-2 Cubs' lead in the eighth but Aoki opened the Milwaukee eighth with a single and scored the run that forced extra innings.
Casey Coleman (0-1), the fifth Cubs pitched Thursday, was brought in to pitch the 10th but Aoki hit a 2-0 pitch for his third home run of the season and ended the game.
Milwaukee's John Axford (1-2) pitched two perfect innings and picked up the win.
Aoki opened the game's scoring with a fourth-inning home run and the Brewers went up 2-0 when George Kottaras singled in Corey Hart.
Chicago got on the board with Koyie Hill's seventh-inning double and took the lead in the eighth. Alfonso Soriano singled with two out and LaHair belted his 12th home run of the year for the 3-2 lead.
Hart had a single that drove in Aoki in the eighth.