Rovers ended a run of four straight defeats in style, with Max Power's vicious strike from Andy Robinson's half-cleared corner handing them an 11th-minute lead.
The U's equalised just before the half-hour mark when Magnus Okuonghae swept home at the far post from Billy Clifford's free-kick.
But Tranmere restored their lead four minutes before half-time through Jean-Louis Akpa Akpro, who pounced on hesitation between Colchester skipper Josh Thompson and goalkeeper Sam Walker to lob the ball into the net.
Akpa Akpro's curling effort flashed just wide before Tranmere extended their lead midway through the second half when Ash Taylor powered home a header from Michael Kay's delivery.
Substitute Cole Stockton drove home a low shot from the edge of the area for Rovers' fourth with four minutes left, before Michael O'Halloran wrapped up Tranmere's win after converting the penalty he had won following Thompson's trip in the area.