James Henry hit an injury-time winner to send Colchester United sliding to their first defeat in 10 games - and The Lions into the Play-Off places for the first time this season.
In a pulsating encounter, Kenny Jackett's side looked to be heading for their first home loss of the season after Anthony Wordsworth's 18th-minute free-kick spun off the unfortunate Marc Laird and crept into the back of the net.
Alan Dunne levelled the scores on 66 minutes with a stunning 25-yard drive and the stage was set for sub Henry, a 60th-minute replacement for Chris Hackett, to fire home a last-gasp clincher.
Lions boss Jackett had the luxury of naming an unchanged team for the third successive game.
There was, however, a first outing for teenage defender Danny Fitzsimons on the bench in place of last Saturday's match-winner Gary Alexander, who was ruled out with a heel problem.
Likewise U's boss Aidy Boothroyd stuck with the same starting line-up that had beaten Walsall seven days ago.
With The Lions unbeaten in five and third-placed Colchester in nine games going into this match, all the makings were there for a cracking game - and such was the frantic pace in the opening stages that it could have been 2-2 with just five minutes gone.
There were just 84 seconds on the clock when great work by Danny Schofield on the left saw his cross half-cleared and fall invitingly for Jimmy Abdou, but he sent his 16-yard drive over the bar.
The U's responded and twice went close in as many minutes when Kayode Odejayi flicked the ball wide and was then denied by an excellent block from keeper David Forde when he was put clean through.
In between times, Schofield had also managed to work a one-one-one opportunity with visiting keeper Ben Williams, only to see his fierce drive parried.
The former Yeovil man was thwarted again on 14 minutes, taking one touch too many before seeing his effort parried by Williams again.
Colchester broke the deadlock four minutes later when referee Graham Horwood awarded a cheap free-kick after Kevin Lisbie ran into Jack Smith and Danny Schofield on the right flank
Wordsworth drilled the ball into the area and the ball flew off Laird and past the unsighted Forde at his far post.
Back came The Lions though, with Neil Harris and Hackett setting up Steve Morison, who with a smart shimmy shook off his marker and let fly with a fierce effort that was blocked by the massed Colchester defence.
Millwall continued to prise and probe a well-organised visiting rearguard with Morison and Hackett going close before the break, the former seeing his drive cleared for a corner and the latter, with a left-foot scorcher that flew inches past the post.
Abdou swept the ball over the bar on 54 minutes as Jackett's side tried to unlock a resolute Colchester defence.
And manager Jackett came up with the winning combination making astute substitutions that paid off perfectly.
Henry had only been on the pitch for six minutes when he swung over a deep corner from the right, the ball was cleared, but only as far as right-back Dunne, who hit an absolute pearler into the bottom left hand corner.
What a way to score your first league goal since 6th November 2007!
Four minutes later Jason Price entered the fray for Morison, and came within a whisker of handing The Lions a 2-1 lead, seeing his header from Jack Smith's dinked delivery flash wide of the target.
Defender Dunne, who had a stormer rampaging up and down the right flank, powered into the area 11 minutes from time and rather than going for glory again, selflessly squared for the unmarked Harris in the middle, only for the striker to direct his shot straight into the hands of the keeper.
The Dunne-Harris combination nearly came up trumps again shortly after - this time Dunne's shot forced Williams to parry at full stretch, Chopper's follow-up was blocked by the keeper and the ball ricocheted off Harris and past the post from four yards.
Colchester substitute Steven Gillespie could count himself the luckiest player on the pitch - because he should have been sent straight off it following an horrendous two-footed sliding lunge that, if Tony Craig had not managed to get out of the way, could have caused serious damage.
The howls of protest from the players and crowd fell on deaf ears, and quite inexplicably, Colchester were awarded a free-kick with Lions skipper Paul Robinson booked into the bargain.
A combined sense of injustice and determination were channelled superbly by The Lions as the game reached a frenzied finale.
Colchester were awarded a couple of soft free-kicks in quick succession, the first was comfortably cleared by Millwall, the second, saw Wordsworth's curler smack the top of the bar.
But with three of five minutes of injury-time played, The Lions were handed a free-kick of their own after Laird was sent tumbling 25 yards out.
Up stepped Henry to despatch a perfect low shot through the outtsretched hands of keeper Williams to send the home fans into ecstasy.
The two minutes of added time thereafter was greeted by a chorus of whistles from the home crowd. But their anxiety was replaced by relief when Mr Horwood blew for full-time to send the Lions fans home happy once again.
Millwall: Forde, Dunne, Smith, Abdou, Robinson, Craig, Schofield, Laird, Harris, Morison (Price, 70mins), Hackett (Henry, 60mins). Subs not used: Sullivan, Bolder, Grabban, Martin, Fitzsimons.
Booking: Laird (19mins)
Scorers: Dunne (66mins), Henry (90+3mins)
Colchester United: Williams, Okuonghae, O'Toole, Platt, lisbie, Wordsworth, Tierney, White, Odejayi, Batth, Payne. Subs: Cousins, Izzet, Ifil, Reid, Fox, Gillespie, Elito.
Bookings: O'Toole (41mins), Wordsworth (42mins)
Scorer: Wordsworth (18mins)
Ref: Graham Horwood
Att: 10,036 (away 514)