Gillingham's return to Sky Bet League One did not go as planned as a goal two minutes from time from Colchester substitute Andrew Bond condemned Martin Allen's men to a 1-0 defeat.
It could have been a very different story altogether for Gillingham, though, had birthday-boy Danny Kedwell scored rather than hit the woodwork in an entertaining first-half that surprisingly failed to produce a goal.
Allen chose to partner Kedwell - celebrating his 30th birthday - and summer signing Cody McDonald up front, and it was the former who was looking like the hosts' biggest threat.
He smashed a ninth-minute effort narrowly wide after Charlie Lee's throw had caused panic in the box, and also crashed an effort off the woodwork when he spotted the visiting goalkeeper Sam Walker off his line.
Walker then made a good save from Lee late in the half.
Colchester had a rare chance at the other end that almost broke the deadlock after the break, Stuart Nelson's flying save denied Marcus Bean.
Chris Whelpdale's low drive nearly made the breakthrough, as Walker parried into the path of Amine Linganzi, but the linesman's flag was raised for off-side.
Yet, with two minutes left, Colchester substitute Bond latched onto a low cross and drilled it home to hand Colchester the three points.