Wayne Brown put Colchester ahead in first-half injury time, heading home from Kevin Watson's free-kick.
Dwight Yorke drew Sunderland level after 54 minutes, finding space to head home a cross from Daryl Murphy.
Richard Garcia spun to put Colchester back in front with eight minutes left and Jamie Cureton added a penalty after he was fouled by Dean Whitehead.
Sunderland manager Roy Keane:
"We're disappointed to lose but it's still in our hands and we'll try and bounce back next week.
"When we got back to 1-1 we thought we could get something from the game but it wasn't to be.
"I have no problem with the effort and desire we showed and you have to give
credit to the opposition."
Colchester: Gerken, Duguid, Baldwin, Brown, Barker, Garcia, Watson, Izzet, Jackson (Ephraim 35), Iwelumo (Guy 76), Cureton.
Subs Not Used: Davison, White, McLeod.
Booked: Cureton, Duguid.
Goals: Brown 45, Garcia 82, Cureton 89 pen.
Sunderland: Ward, Whitehead, Evans, Nosworthy, Collins, Edwards, Leadbitter (Elliott 85), Yorke, Murphy (Stokes 73), John (Wallace 60), Connolly.
Subs Not Used: Fulop, Liam Miller.
Booked: Murphy, Yorke.
Goals: Yorke 55.
Ref: L Probert (Gloucestershire).