The game got off to a lively start, with the visitors hitting the post after just two minutes and the U’s taking the lead three minutes later.
They had further chances of their own in an enthralling match, as they defeated the Gills and extended their unbeaten run at home to nine matches.
But, back in front of their own supporters, they worked to the end in the second half with a strong defensive display to repel a Gills fightback.
A dramatic first half saw chances aplenty as the U's continued their attacking thrust of the past two away games.
Colchester United toppled the league leaders Gillingham on Saturday to make it back to back wins and climb up to twelfth in the League One table.
It was McDonald who hit the outside of the woodwork with Jones beaten, but the U’s scored in what is becoming typical fashion on five minutes.
Harriott nicked the ball in midfield and burst forward, laying it off to the onrushing Massey outside of him. He took two touches and lashed home a shot to put the U’s in front.
The U’s were in front for just three minutes, as Norris broke the home defensive lines to bear down on goal and finished with similarly calm aplomb to level it up.
Vincent-Young became the first to go into the book on eleven minutes for a foul on Dack, but it looked like the U’s man had got the ball ahead of the Gills man.
The game was full of chances. Next, Moncur had an acrobatic volley blocked at source, before Norris stung the palms of Jones with a fierce, rasping shot.
It finally began to settle down around the midpoint of the half, although bookings came at fairly regular intervals.
Goalscorer Massey got another shot off that Nelson held with Sordell and Moncur waiting as both teams kept pushing forward.
And the U’s got their rewards on the half hour mark. Briggs showed real persistence down the left to retrieve the ball two or three times.
Moncur fed the ball back to him and he in turn set up Harriott, who absolutely smashed home to put the U’s back in front.
The U’s thought they might be pegged back five minutes after going in front, when they conceded a penalty for handball by Kent.
McDonald stepped up but penalty hero from Tuesday Jamie Jones did it again with another penalty save.
The U’s then tried to extend their lead and went close on 43 minutes. Sordell did some great work in the middle of the pitch and laid it wide to Massey, whose lobbed shot ended just wide of the far post.
The home side led at the break, but it was the visitors who had the first sight of goal eight minutes into the second half.
It was, unfortunately, a chance of the U’s making as they gave away the ball in a dangerous position, but Jones pulled off a fine double save.
At the other end, Edwards brought down a clearance and volleyed it towards goal, but it went just wide of the target.
After the relentless pace of the first half, though, it was a quieter second period with chance for Edwards a rare sight of goal.
Sordell’s power was proving crucial for the U’s and he combined well with Moncur to set up Harriott who shot over the bar.
At the other end, Gills top scorer Dack got a sight of goal with a flashing header from Jackson’s cross, but it was an easy collect from Jones.
The U’s had a worry with fifteen minutes to go as the visitors had a free kick in a dangerous position, but the wall again did its job as the home side held firm.
The home side made their first change with nine minutes to go, as Ambrose came on for goalscorer Harriott.
Not long afterwards, the visiting support were not happy when it appeared that Jones punched the ball outside of his box, but the referee and linesman were unmoved.
The ball went out for a throw but, although Egan won the header, it drifted wide of goal.
At the other end, the U’s were agonisingly close to extending their lead. The corner was initially cleared, but Kent sent in a superb cross that Sordell just missed with a diving header.
The visitors continued to seek an equaliser but the U’s almost got a third from a counter attack. Massey burst forward and sent over a cross for the run of Gilbey, but it was cleared in the nick of time.
The game was drawing to a close with the Gills pressing the home side back. But for all of the visitors pressure in those dying stages - and there was plenty - the U's held firm to ensure back to back wins.
The Gills almost drew level through Ehmer who met a cross at the far post and went back across the face, but it went wide of the far upright.