Football League Wrap: Tykes win U's thriller
Sam Winnall netted a powerful low drive - his sixth goal in four games - to give the the hosts a fourth minute lead, but Sanchez Watt levelled with a quarter of an hour played on Colchester's first attack.
Conor Hourihane restored Barnsley's advantage in the 55th minute from the penalty spot after Sean Clohessy's foul on Devante Cole.
Hourihane then set up Peter Ramage to head a third before United's Freddie Sears set up a grandstand finish, but Barnsley were able to hold on for their third successive win in all competitions.
In League Two, Ryan Bird scored a 79th-minute winner as Cambridge United came from behind to beat Northampton Town 2-1 at the Abbey Stadium.
An uneventful first-half gave way to drama early in the second as Ivan Toney headed home Chris Hackett's cross, only for Adam Cunnington to haul Cambridge level from Liam Hughes’ corner a minute later.
Bird then sealed three points by converting Kwesi Appiah's low centre as Cambridge climbed to eighth.