Adam Smith picked the perfect time to score his first ever goal for Millwall as he smashed a 75th-minute winner to sink struggling Bristol City at The Den.
Smith, on loan from Tottenham until 30th January, was rewarded for another fine individual display when he blasted past City keeper Tom Heaton from James Henry's cross.
Dany N'Guessan had earlier produced a fine finish to fire The Lions into a 20th-minute lead and Kenny Jackett's men looked to be comfortably heading for three points.
But Jon Stead grabbed his first goal since August to haul the visitors level on 64 minutes before right-back Smith thumped home to secure Millwall's first victory in four games.
"It's great to get a win after two losses," enthused manager Jackett. "I was very pleased with that; their keeper was far busier than ours and kept them in it with some excellent saves."
The Lions certainly started positively and could have taken the lead with just 72 seconds on the clock when Darius Henderson stooped to meet Liam Feeney's cross but sent his header narrowly wide.
City offered very little as an attacking force in the opening half and instead, were forced on the back foot for long spells.
It took last-ditch clearances from defenders Matthew Bates and Liam Fontaine to avert the danger from deliveries by James Henry and Feeney whilst keeper Tom Heaton was called into action for the first of many occasions, tipping away an angled drive by Liam Trotter.
However City, who have been unable to keep a clean sheet all season, found themselves trailing after 19 minutes when N'Guessan was sent through by Henderson's flick, out-paced Bates and hit a cracking left-foot shot that gave Heaton no chance in the visiting goal.
Millwall had a penalty appeal waved away by referee Roger East just before the break when Mark Beevers was clearly impeded by Liam Fontaine as he rose to meet Henry's corner. Even though he somehow managed to connect with the ball, Beevers' header flashed narrowly wide when given the opportunity to connect without Fontaine's arms around his waist, he may have directed the ball into the back of the net instead!
Robins boss Derek McInnes decided to take drastic action and made a double substitution before the break replacing Fontaine and Paul Anderson with winger Martyn Woolford and striker Sam Baldock.
The visitors arguably could not have been as poor in the second half as they were in the first, and that proved to be the case as they produced a much-improved display after the break.
Midfielder Neil Danns was denied by Lions keeper David Forde, who saved at full stretch to turn Neil Danns' low drive round the post for a corner and he was called into action once more, this time tipping Baldock's low drive away.
City were back on level terms on 64 minutes when Albert Adomah's lofted ball caught the home defence flat-footed and Stead capitalised on the hesitancy, rifling into the left-hand corner of the net to level matters.
Millwall were stung into acyion and responded in a positive fashion, with long-range efforts from Trotter and Smith forcing Heaton into spectacular finger-tip saves.
Urged on by the home crowd, Millwall edged back in front with just 15 minutes remaining. Henry's deep free kick was headed back across goal by Trotter and right-back Smith came steaming forward and hit an unstoppable shot that gave Heaton no chance.
A superb piece of skill by Trotter so nearly brought a third goal for Millwall, but Heaton somehow got his fingers to the ball and turned the midfielder's half-volley away for a corner.
Five minutes of injury-time seemed like an eternity for The Den faithful as the visitors tried to find a way through for a second time. Although Millwall looked to be comfortably winding the clock down, there was still time for Forde to spill Adomah's shot and to the great relief of everyone grab the ball at the second attempt with Baldock waiting to pounce.
Forde, A.Smith, Lowry, Abdou, Shittu, Beevers, Feeney, Trotter, N'Guessan (Batt, 90mins), Henderson (J.Smith, 83mins), Henry. Subs not used: M.Taylor, Dunne, Osborne, Wright, Marquis.
Bristol City: Heaton, Wilson (Taylor, 88mins), Bates, McManus, Fontaine (Baldock, 44mins), Cunningham, Adomah, Danns, Skuse, Anderson (Woolford, 44mins), Stead. Subs not used: Gerken, Elliott, Edwards, Carey.
Bookings: Danns (45+2mins), Adomah (90+4mins)
Att: 9,784 (away 394)