Gills leave it late to secure victory in Essex.
Max Ehmer’s late free-kick gave Gillingham their second victory of the season in the Checkatrade Trophy and a place in the next round of the competition.
The game looked destined to go to penalties, but the centre-back stepped up with the last chance of the game and beat Colchester keeper Sam Walker with an excellent effort to clinch a 1-0 win over the U's.
Tom Eaves and Darren Oldaker also had chances for the visitors while Sean Murray narrowly missed the target with a powerful right footed effort.
Interim Manager Peter Taylor made six changes to the side that lost 1-0 against Blackburn Rovers on Saturday.
Steve Arnold, Tom Eaves, Oldaker, Elliott List, Aaron Simpson and Finn O’Mara came into the starting XI with Tomas Holy, Gabriel Zakuani, Mark Byrne, Lee Martin, Connor Ogilvie and Conor Wilkinson all rested.
Jack Tucker was among the substitutes, as was Stuart Nelson who was named in the first-team squad for the first time since pre-season.
As for Colchester they also made a string of changes with former Gills right-back Ryan Jackson on the bench. Doug Loft wasn’t involved but watched on from the sidelines, with the injured Brennan Dickenson lending his support as he recovers from an ACL.
Gills started the game well with Sean Clare and Oldaker looking to get forward from midfield, but it was Colchester who registered the first attempt on ten minutes. Murray found a yard of space 20 yards out and he looked to find the opposite corner with a low drilled effort but missed the target.
It was a similar story, this time for the visitors, four minutes later. An Eaves flick on found List who, from a difficult angle, forced a fine save from Walker to concede only a corner which he claimed with relative ease.
Colchester progressively began to exert some pressure. Odelusi and Murray both missing the target before Arnold had to be alert to save a low effort from Kinsella following a good knock down by Mikael Mandron.
Sean Clare then had an excellent left footed effort from range palmed wide by Walker. The keeper was at full stretch to prevent the ball nestling in the top corner with the resulting corner-kick dealt with by the Colchester defence.
Both sides made a change at the break; Peter Taylor choosing to bring Billy Bingham on in place of Elliott List.
An early free-kick for Colchester, taken by Kinsella, was deflected wide for a corner-kick which Gills managed to clear as O’Mara was fouled as he attempted to burst out of the box.
The game entered a quiet spell but on the hour mark Gills had a golden chance to take the lead. Clare charged forward from midfield and had options to his left or right; he chose to find Eaves who saw the keeper coming and his shot had a little too much power on it and resulted in the ball clearing the bar.
Moments later and Oldaker produced a piece of individual magic to turn his marker and then set off on a 40-yard run which saw him fly past two players; he took his time to get away an effort but once he did he won a corner which was headed narrowly wide by Ehmer.
Eaves and Oldaker both had efforts collected by Walker as the Gills turned up the wick ever so slightly but still couldn’t find a way through.
Colchester however remained very much in the game and on 72 minutes very nearly took the lead. First Sanki Odelusi was brilliantly denied by Arnold before Murray’s attempt to find the top corner was only just unsuccessful with the ball only just clearing the bar with the keeper stuck to his spot.
With minutes to go Eaves blazed a volley wide of the far post but Gills still had time for one final effort. Ehmer won a free-kick 25 yards from goal, slightly right of centre. He chose to take it himself and brilliantly found the bottom corner with Walker unable to get across in time.
Gills saw out the rest of the game to clinch their second win of the competition.
Colchester: Walker, James, Kent, Kpekawa, Vincent-Young, Comley, Murray, Kinsella, Odelusi (Slater 78), Mandron (Senior 60), Guthrie (Kabamba 46).
Unused subs: Gilmartin, Jackson, Hanlan, O’Sullivan.
Gills: Arnold, Ehmer, Nugent, O’Mara, Simpson, Parker (Nash 82), Hessenthaler, Clare (Chapman 73), Oldaker, List (Bingham 46), Eaves.
Unused subs: Nelson, Tucker, Starkey, Cundle.
Attendance: 684 (69 Gills)
Referee: Mr J Brook