Ten-man Crewe were knocked out of the FA Cup by Colchester in Steve Davis's first game in charge.
Byron Moore put the Alex ahead, but they were reduced to 10 men when captain Ashley Westwood was sent off for a two-footed lunge on Ben Coker.
Lloyd James levelled the scores with a 35-yard strike before Andy Bond put the U's ahead with a sidefooted effort from a corner.
Coker fired in a third, before James grabbed his second in stoppage time.
VIEWS FROM THE DRESSING ROOM
Crewe manager Steve Davis told BBC Radio Stoke:
"Up until the sending-off, I don't think they'd had a chance, so that was a game-changing thing.
"I'm going to defend him, he was over the top and a little bit late, but he needs that tenacious part of his game.
"I apologised to their manager, it was a bad tackle and it did deserve a sending-off."
Colchester United manager John Ward told BBC Essex:
"Second half was pretty emphatic, the first half was level. We were very upset and disappointed with ourselves at half-time.
"We always felt if we could get an equaliser reasonably early, we would get the lift ourselves and that's what happened.
"We were really pleased with the response from the team. That's the third time this year we've put four goals past an opponent. We can do that when we get it right."