It was 3-all when Greg Holland (2-4) hit Keon Broxton with an 0-2 pitch with one out in the ninth. Aguilar hit his 12th homer, and Milwaukee added another run as Eric Thames walked, stole second and Neil Walker's RBI single chased Holland.
Travis Shaw also homered for the Brewers.
DJ LeMahieu got three hits and Trevor Story had two doubles for Colorado. The Rockies remained a game ahead of Arizona for the NL's first wild card and 4 1-2 up on Milwaukee.
Anthony Swarzak (2-0) tossed one inning and Corey Knebel got the last three outs for his 25th save.
The Rockies lost for the first time in 12 home games that Chad Bettis has started. Bettis, who pitched seven scoreless innings Monday in his first start since undergoing cancer treatment, went seven innings again and gave up three runs — all in the third.