An own goal and a strike from Jabo Ibehre sealed all three points for the U's, who also ended Oldham's nine-match unbeaten home run.
Colchester took just eight minutes to go in front as Craig Eastmond crossed from the left and Oldham full-back Ellis Plummer slid the ball into his own net from four yards.
Matteo Lanzoni fired wide for the home side, but Colchester doubled their lead in the 32nd minute when Plummer was caught napping and Dominic Vose set up Ibehre for a simple tap-in.
Lanzoni and Danny Philliskirk both went close just after the break as Oldham built pressure without testing U's goalkeeper Sam Walker.
When Walker was called into action after 72 minutes, he made a superb save from Connor Brown's 20-yard drive.
Oldham's John Pritchard hit the woodwork from long range, but Colchester could have added a third when Ryan Dickson fired inches wide.