Jose Baxter's 14th goal of the season cancelled out Drey Wright's opener for the visitors, but Colchester are now unbeaten in five away games.
Colchester were gifted the lead after 20 minutes when Oldham goalkeeper Dean Bouzanis fumbled Andy Bond's weak shot into the path of Wright, who rifled home from eight yards.
Lee Barnard had a chance for the Latics and Robbie Simpson fired just wide from 25 yards, but Colchester also went close when Wright's volley was saved by Bouzanis.
Oldham levelled after 68 minutes when Lee Croft sent in a right-wing cross and Baxter directed a deft, 10-yard header in off the crossbar.
Colchester found a quick response and Brian Wilson's free-kick was parried by Bouzanis before Jabo Ibehre headed against the crossbar from close range.
Oldham pressed in the closing stages and could have won it 10 minutes from time, only for Baxter to slam his volley off target.