Marc Goodfellow marked his debut with a late winner as Bristol City spoiled Gary Mills's start to his reign as Notts County manager.
City went in front through Lee Peacock's 13th of the season after the visitors had dominated early on.
County levelled before half-time when Tony Butler headed into his own net.
But Goodfellow, who was signed on the eve of the game from Stoke, headed home Brian Tinnion's cross in stoppage time to secure all three points.
Notts County: Mildenhall, Fenton, Barras, Richardson,
Nicholson, Bolland, Caskey, Riley, Brough, Stallard, Hackworth.
Subs: Deeney, Nurse, Francis, Harrad, Bostock.
Bristol City: Phillips, Carey, Coles, Butler, Hill,
Aaron Brown, Doherty, Tinnion, Marvin Brown, Peacock, Miller.
Subs: Bell, Stowell, Goodfellow, Fortune, Lita.
Referee: G Laws (Tyne & Wear)