Goals from Warren Harris and Lee Barney had put the Rebels in a strong position to go on and win the game, but a series of mistakes led to their downfall.
Slough looked confident early on and took the lead on 19 minutes through Harris, who with his back to goal, turned and fired past Zac Barrett.
It took just four minutes for City to get back on level terms. The ball was played to James Hall on the left hand side of the penalty area, and he cracked an unstoppable volley into the roof of the net, giving Mark Scott no chance.
But Slough responded with 35 minutes played, and Lee Barney got his name on the score sheet once again after a slick piece of build-up play. Barney found himself unmarked and he was able to turn quickly and fire past Barrett, who was rooted to the spot, from just inside the area.
Slough were forced into a half-time change, with Dan Hicks replacing Adam New, and the second-half started with Cambridge quickly out of the blocks. Just five minutes in, the hosts were level again through captain Buster Harradine. A poor clearance from Scott left Harradine all alone just outside the box, and he was able to tuck the ball past the keeper with aplomb.
Two goals in the final ten minutes secured all three points for Cambridge as Hall completed his hat-trick.
First, on 81 minutes another mistake at the back from Slough was punished as Hall turned well and fired the ball into the unguarded net.
Two minutes later, Slough conceded a penalty which Hall duly converted to complete his treble and confirm the victory.
Cambridge City Line up
Zac Barrett, Paul Cooper, Charlie Day, Adam Murray, Lee Chaffey, Ieuan Lewis, Charlie Brown, Buster Harradine (c), James Hall, Danny Kelly, Harry Norman. Subs: Ali Richardson, Neil Midgley.