Rangers dumped out of Europe
Stuttgart, who have six points and are third in Group G, need to beat Unirea Urziceni at home in their final game on December 9 to progress. Romania's Urziceni have eight points, two behind group leaders Sevilla.
Rangers, whose previous Champions League home games this season ended in 4-1 defeats - against Sevilla and Unirea - have two points.
"It is a superb feeling and I cannot get enough of it," Stuttgart manager Markus Babbel told reporters.
"We created good chances and the only slight hitch was maybe we could have scored more."
Stuttgart fired out their early intent when Cacau forced a brilliant save from Rangers keeper Allan McGregor.
The hosts failed to heed the warning and Sebastian Rudy side-footed an easy opening goal after 16 minutes when he was left unmarked 10 metres out on the right to pounce on a low ball from Aleksandr Hleb.
Rangers striker Kris Boyd passed up a fabulous chance to level six minutes from the interval after Kenny Miller seized on a poor pass from Pavel Pogrebnyak on the right and charged forward to sweep in an inviting cross from the right.
But Boyd planted a seven metre header over the crossbar with only keeper Jens Lehmann to beat.
Stuttgart went 2-0 up Zdravko Kuzmanovic headed the second just before the hour from a fine cross on the right by Rudy.
The away side had chances to add to their lead. McGregor parried a powerful 25-metre shot from Cacau and somehow managed to thrust out a leg while grounded to divert the rebound from Pogrebnyak to safety.
McGregor then pulled off another smart save when he managed to block a fierce low shot from the right by substitute Thomas Hitzlsperger.
Rangers manager Walter Smith was left to rue his side's home form in the tournament.
"We have not been good enough when the expectation level has been to win the game," he said.
"We certainly had to struggle at home trying to impose ourselves."
Asked why that was Smith replied: "We are more comfortable away from home when the expectation is not as great to go forward and win the game."