Joe Dunne’s side began the day a point above the bottom four, but first-half goals from Marcus Bean, Alex Wynter and Freddie Sears’ penalty put them in control.
Stuart Dallas pulled one back for Brentford on the stroke of half-time, but Sears scored his second midway through the second half.
Jabo Ibehre squandered a good early chance for Colchester, while Bees goalkeeper David Button denied Sears.
The U’s took a 25th-minute lead through Bean, who bundled in Brian Wilson’s free-kick under pressure from George Saville.
The U’s doubled their lead three minutes later when loanee Wynter powered home a fine header from Ryan Dickson’s corner and Sears scored from the spot to make it 3-0, after Alan McCormack had fouled Sanchez Watt.
Brentford pulled a goal back in first-half stoppage-time when Dallas lashed in from 20 yards from Clayton Donaldson’s lay-off.
But Sears restored Colchester’s three-goal cushion in the 64th minute after he thumped into an empty net after Button and James Tarkowski had failed to deal with a long pass.
U’s goalkeeper Sam Walker saved a penalty from Alan Judge, who had taken the spot-kick after being fouled by Alex Gilbey with 14 minutes remaining, as Colchester claimed a huge win.