They won courtesy of an early Fredi Kanoute penalty, although they dominated throughout.
Stuttgart needed to beat Unirea Urziceni to ensure their progress and they made an astonishing start at the VfB Arena.
The Germans, under new coach Christian Gross, took the quickest 3-0 lead in Champions League history as goals from Ciprian Marica, Christian Traesch and Pavel Pogrebnyak finished the Romanians off with only 11 minutes gone.
Dan Petrescu's side managed a second-half consolation through Antonio Semedo, but they must settle for a Europa League place.
Arsene Wenger's side had plenty of chances, but they lost 1-0 in Greece thanks to Leonardo's well-taken second-half goal.
There was a hammer blow late on in the group's other game, as Standard Liege and AZ Alkmaar met at the Maurice Dufrasne stadium.
AZ took a first-half lead through Jeremain Lens, but Sinan Bolat struck five minutes into stoppage time to earn Standard a place in the Europa League at the Dutch side's expense and become the first goalkeeper to score in the Champions League from open play.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.