Captain Jon Daly's last-minute penalty came after the Terrors had raced into a 3-0 lead inside eight minutes - before Billy McKay's hat-trick followed by Gary Warren's 86th-minute header looked like earning the points for the second-placed visitors.
United went ahead through Josh Meekings' early own goal before further strikes from Daly and Rudi Skacel seemed to have them home and dry, until McKay sparked a comeback which few inside Tannadice would have predicted.
Peter Houston's side came out with all guns blazing and they took the lead in the fifth minute when Barry Douglas whipped over an inch-perfect cross for Daly, whose effort was going off target until Meekings turned it into his own net past Inverness keeper Antonio Reguero.
Daly could not believe his luck as he made it 2-0 a minute later, following a mix-up in the Inverness defence. John Rankin's hopeful ball forward led to Graeme Shinnie panicking under pressure and hit his clearance straight at Daly - who knew little about it as the ball rebounded off him before nestling in the net.
Skacel then made it 3-0 with his first goal for the home side since signing in September. This time Stuart Armstrong split the Caley Thistle defence with a weighted pass for Skacel to race onto and the Czech star steadied himself before firing his low right-foot shot across Reguero.
But McKay started the Inverness revival in the 26th minute with a close-range header from Richie Foran's half-volley, with Radoslaw Cierzniak in the home goal well beaten.
Then, two minutes later, the on-song striker made it 3-2 by turning home a free header after United had had failed to deal with Aaron Doran's corner.
And in the 62nd minute McKay levelled for the never-say-die visitors. Willo Flood fouled Ross Draper as he made his way into the United penalty area and McKay stepped up to complete his hat-trick by sending Cierzniak the wrong way from the spot.
The comeback looked complete four minutes from time when defender Warren headed home in off the post from Shinnie's cross but right at the end Daly's penalty made it 4-4 after Foran's foul on United substitute Milos Lacny.