The hosts were left stunned after drawing level having been under the cosh for most of the game, but the Rebels regained their lead just seconds after Jake Mawson’s goal.
Slough started on the front foot and were unfortunate not to be in front in the first minute when Lee Togwell’s looping header came back off the far post before being cleared off the line.
Louie Soares found himself with a huge chance to open the scoring on 16 minutes when Scott Davies played him in with a lovely pass over the top, but a defender got back to block.
Just a minute later, Slough hit the post again – this time through Simon Dunn – with a shot from the edge of the area.
Slough were well on top and had another great chance, but Matt Yates saved from Guy Hollis.
But Yates was powerless to stop the away side taking the lead on 23 minutes. Yet another Davies corner found Lee Togwell unmarked six yards out, and he was able to steer a volley home.
City responded well and almost levelled seven minutes from the break. Mawford got his head to a fantastic cross from Joe Hanks, only to see the ball go narrowly over.
Another glorious chance went begging for Slough before the break. Josh Jackman’s pressure forced a mistake from the City defence, allowing Dunn to play in Chris Flood, but the striker’s shot was narrowly wide.
As the second half began, Slough almost immediately doubled their lead, but Yates held well from a Scott Davies strike. Minutes later, Davies tried to catch the City keeper out in spectacular fashion with an effort from inside his own half, but Yates managed to get back and claw it over the bar.
Slough peppered the Gloucester goal, with Hollis having a shot blocked and Mark Nisbet firing narrowly wide.
Whilst the Rebels were dominating the game, they really needed a second goal to show for their efforts, and instead Flood fired over and a dangerous ball across the City goal flashed all the way across without a touch.
City began to have more of the ball with Mawford having a growing influence on the game – and on 69 minutes Slough were punished for their profligacy when the striker finished a brilliant cross from Hanks on the left-hand side to briefly level the scores.
However, Slough stormed back from the kick-off, and Jackman crossed in for substitute Ben Harris, who sent a firm header past Yates to stun the home support.
Further chances followed for Slough with Ben Harris having an effort chalked off for offside and Davies putting a free kick wide. Gloucester, meanwhile, rarely looked capable of recovering for a second time as the game fizzled out with Slough deservedly taking all three points.
Gloucester City Line up
Matt Yates, Mat Liddiard, Jack Deaman (Jamie Edge 77), Joe Hanks, Sam Avery (c), Spencer Hamilton, Joe Parker, Chris Knowles (Jamal Lawrence 77), Jake Jackson (Ben Seymour 45), Jake Mawford, Adam Page. Unused substitutes: Matt Williams, Isaac Kelly