Danns had become a father for the first time on Monday evening when his partner gave birth to a baby son, Jayden, in Liverpool.
But the delighted Danns traveled down from Liverpool to take part in this latest League One encounter and scored twice to boost his tally for the season to 11 and more importantly propel the U's into second spot behind Essex rivals Southend.
Colchester are on an amazing run at the moment which has featured 15 wins from their last 17 matches.
And they did it the hard way against in-form City, having conceded a goal after just two minutes.
Winger Scott Murray broke the deadlock when his deflected shot deceived home keeper Aidan Davison for his 10th goal of the season.
Bristol City have pulled clear of the relegation zone after a run of seven matches unbeaten, but they were on the rack for most of the evening and so surrendered their unbeaten record.
Striker Gareth Williams had not scored a league goal for almost a year but he came up trumps with the equaliser in the 27th minute.
Welshman Williams, whose last league goal had been in the 5-0 defeat of Walsall in late January 2005, stroked home a 20-yard shot following a pass by Karl Duguid.
Colchester took the lead with virtually the last kick of the first half. Danns was the marksman, following good work by Mark Yeates and Kevin Watson. It was Watson who slid the ball into the path of the midfielder who made room for himself before drilling home a wonder goal.
On-song Danns effectively made the game safe by putting the U's 3-1 up just after the hour mark. City's Brazilian keeper Adriano Basso jumped with Colchester striker Chris Iwelumo following John White's high ball into the box but he could not clear the danger and Danns swept home the rebound from point-blank range.
City did grab a consolation in the first minute of stoppage time thanks to a smart finish from substitute Marcus Stewart.
The former Ipswich and Sunderland striker rammed home the loose ball after Colchester had failed to deal with a corner.
Livewire Stewart also had a long-range shot saved by Davison in the third minute of stoppage time, but the visitors had left it too late to snatch the point that they hardly deserved.