Rangers looked to be in real trouble as they trailed to a Kevin Kuranyi goal but Christian Nerlinger hauled them back into the game with 17 minutes left.
And then with 11 minutes remaining Lovenkrands struck with a quite fantastic solo goal as he burst in from the touch before hammering a sensational left foot shot into the left corner.
Now Rangers can head to Athens with fantastic confidence and belief after one of the really great Ibrox nights.
The atmosphere could not have been better as Rangers re-entered the Champions League arena after a three-year absence.
The Caledon Tenors and the Rockettes cheerleaders had done their bit to warm the crowd up and there was an explosion of sound as the Light Blues went into battle.
And there was almost a sensational start as Michael Mols peeled away from his marker Fernando Meira inside the first minute to take a pass from Mikel Arteta but he was flagged for offside.
It was the positive start Rangers wanted and two minutes later Mols again indicated his zest for the fight by winning the ball on the byline from Andreas Hinkel and then forcing the German defender to foul him.
However, Stuttgart seemed to handle the early Rangers onslaught and settled into the game. Indeed there was a clear warning in 14 minutes when dangerman Alexander Hleb burst through and only brave goalkeeping from Stefan Klos denied him.
Two minutes later Zurab Khizanishvili had to make a vital challenge on the same player as the Belarussian threatened to penetrate the Rangers defence again.
It seemed to spark some more intensity from Rangers who seemed to have a game plan of controlling the contest rather than attempting to roll over the top of the Bundesliga side.
Arteta forced Hleb into a late challenge in 23 minutes and it earned the Stuttgart midfielder a yellow card but there might have been much more out of the incident for Rangers.
Arteta delivered the free kick and Paolo Vanoli was unchallenged as he powered a header towards the Stuttgartt net but Timo Hildebrand threw himself to his left to push the ball wide for a corner.
Rangers should have scored from this situation too. Arteta’s corner was cleared only as far as Emerson and his ball into the box found Shota Areveladze in acres of space.
The hero of Copenhagen seemed certain to score and tried to drill a low shot into the right corner but it hit Hildebrand’s left boot and deflected wide. The Stuttgart keeper did not know much about it but it left Rangers totally frustrated.
Alex McLeish was probably still cursing his luck when he was forced into a change with just over half an hour on the clock.
Henning Berg and Fernando Ricksen were involved in a nasty collision of heads and the Dutchman came off much the worse.
Ricksen looked to be in some trouble as he was treated on the field and had to be taken off by stretcher and was replaced by Maurice Ross.
In fairness, Ross looked bright as he over-lapped on the right and Rangers still has a grip of the game but they looked lost a terrible goal nearly three minutes into first half stoppage time.
Nerlinger gave away a free kick 35 yards out in a central area when he tripped Hleb and you could just sense something as going to happen.
Centre back Marcelo Bordon struck the dead ball low with his left foot and his effort thumped off the left hand post. Rather fortuitously in bounced into the middle of the six-yard box instead of deflecting wide and Rangers were totally exposed.
Kevin Kuranyi was first to the loose ball and he could scarcely believe his luck as he slotted the ball into the net.
McLeish made an immediate switch by bringing on Peter Lovenkrands to replace Vanoli at half-time, acutely aware that he needed more firepower up front.
However, Rangers still seemed sluggish in the early moments of the second hald and also susceptible to attacks on the break when offensive moves of their own broke down.
Emerson seemed to lack the sharpness and mobility for a game of this calibre and McLeish took him off after 65 minutes putting Capucho on to patrol the right side with Arteta moving into a deeper role.
Rangers certainly needed something to try to salvage something from what had been a desperately disappointing night.
Michael Ball almost produced something in 67 minutes with a good ball into the box for Arveladze who took the ball down well on his chest and then hit a decent left foot shot but Hildebrand was right behind it.
However, there was even better to come six minutes later when Rangers roared back into the game and you could feel the sense of joy and relief around the stadium.
It just had to Nerlinger, a Bundesliga veteran, who engineered the comeback with a driving run from midfield.
The former Bayern and Dortmund star tried to play a one-two with Mols an although he was foiled in that regard the ball came back into his path off a Stuttgart defender and he wasted no time in stabbing a left foot shot into the net.
The Germans were rattled and the Rangers fans roared for more. Boy, did they get it.
Stuttgart coach Felix Magath must have felt there was little danger as Zurab Khizanishvili played a cross field pass to Lovenkrands on the left touchline.
However, the deadly Dane stunned Magath and everyone else in the ground with one of the great Ibrox European goals.
Lovenkrands slipped inside a despairing challenge by Hleb and only had one thing on his mind as he burst for the box.
And from fully 25 yards he hammered a left foot shot which ripped into the left corner of the net and the fans went bananas. Cue hand-spring and bedlam.
A game which had seemed beyond them was suddenly in Rangers’ grasp and they managed to hold on for a remarkable and vital win.
The four minutes of injury time were almost painful. Indeed Lovenkrands might have scored two more on the breakaway, hitting the bar and then missing from six yards after Capucho set him up.
However, it mattered little. The Danish star has got Rangers off to a Champions League flier.
RANGERS: 1-Klos; 2-Ricksen (21-Ross 31), 25-Berg, 15-Khizanishvili, 18-Ball; 4-Emerson (20-Capucho 65), 23-Arteta, 8-Nerlinger, 15-Vanoli (26-Lovenkrands 45); 10-Mols, 7-Arveladze.
Subs not used – 22-McGregor, 9-Ostenstad, 12-Malcolm, 27-Hughes.
Bookings: Mols (25), Emerson (53), Nerlinger (74), McGregor (82), Ball (88)
VfB STUTTGART: 1-Hildebrand; 2-Hinkel, 6-Fernando Meira, 5-Bordon, 12-Gerber; 15-Hleb, 20-Soldo, 13-Tiffert, 16-Heldt (7-Meissner 69); 22-Kuranyi, 18-Cacau. (11-Amantidis 45)
Subs not used – 23-Heinen, 3-Wenzel, 8-Vranjes, 19-Szabics, 21-Lahm.
Bookings: Hleb (23), Heldt (44)
Ref: Gilles Veissiere (France).