Davis Keillor-Dunn scored an added-time brace as Oldham survived a second-half fightback from struggling Colchester before sealing a 5-2 League Two victory at Boundary Park.
The result, which was Oldham's second win on the bounce, leaves the U's - who have not won on their travels since early December - just five points above the relegation places.
Oldham midfielder Dylan Bahamboula twice went close in the early stages.
The Congo international forced Dean Gerken into a decent save, then fired a low 25-yard strike inches off target.
The hosts took the lead eight minutes before the break when Conor McAleny slotted home his 19th goal of the season in all competitions from the penalty spot after Tom Eastman tripped Keillor-Dunn.
Alfie McCalmont then doubled Oldham's lead, curling home a super free-kick off the post three minutes ahead of half-time.
Defender Carl Piergianni made it three in the 56th minute, smashing the ball into the roof of the net after substitute Nicky Adams' corner was not cleared.
Minutes later Bahamboula smashed a shot against the post, while Colchester skipper Harry Pell then did likewise at the other end.
Frank Nouble reduced Colchester's deficit when he notched a fine solo goal after 64 minutes, before Tom Eastman's long-range thunderbolt gave the visitors real hope with nine minutes left.
However, two late close-range finishes from Keillor-Dunn meant League Two's highest scorers Oldham notched another five to take their tally to 64.