Los Angeles was without its three biggest stars but still managed to extend its unbeaten streak to four matches (2-0-2). David Beckham and Juninho were serving suspensions, and Landon Donovan was out with an inflamed right knee.
Dominic Oduro scored in the 88th minute for Chicago (1-3-1), which has lost three straight.
Barrett put Los Angeles in front in the 42nd minute, converting from 10 yards out. Gonzalez's perfect header made it 2-0 in the 72nd minute.
The Galaxy also played without midfielder Jovan Kirovski, who served the second of his two-game suspension for verbal abuse of an official.