Mellor fired in powerfully from close range after the U's defence had failed to clear their lines to cancel out Andrew Bond's opener.
Ian Henderson's fierce 25-yard drive flashed just wide for Colchester early on, while Clinton Morrison saw his close-range effort blocked by a combination of the post and Paul Reid.
But Colchester were ahead, five minutes into the second half.
A flowing attack saw Henderson pick out Andrew Bond, who curled a superb shot with the outside of his boot past Nicky Weaver from 20 yards for his first ever league goal.
David Mooney came agonisingly close to doubling Colchester's lead soon after when his well-struck low shot came back off the foot of the post, with Weaver beaten again.
But Mellor powered his way through to score with six minutes to go to secure Alan Irvine's side a share of the spoils.