Home game in the Second Round.
Gillingham's visit will be during the week commencing October 6th and more details to follow early next week.
The match will be Tony Humes' first cup game in charge of the U's, after he was given the manager's job earlier this week.
The U's were given a bye in the First Round of the competition but will face the Gills as they begin the journey to Wembley in the lower league competition.
Colchester United will face Gillingham in the Second Round of the Johnstone's Paint Trophy after the two teams were paired together in Saturday's draw.