Striker Gary Hooper opened the scoring in the 21st minute when he capitalised on a mistake by Spartak defender Juan Insaurralde but that lead was cancelled out in the 39th minute by Ari, after good work by the impressive Emmanuel Emenike.
But the Scottish champions were not to be denied and, after defender Marek Suchy conceded a penalty in the 80th minute for a clumsy barge on Georgios Samaras, up stepped Commons to slam the ball in off the bar.
Two minutes from time Spartak midfielder Kim Kallstrom picked a second yellow card for a foul on Commons who was taken off on a stretcher, the only sour note in a momentous night for Neil Lennon's side who finished second in Group G behind Barcelona with 10 points and who are in the knockout stages for the first time since the 2007/08 season.
The Hoops had to fight their way through two qualifying rounds and were then unfancied when drawn alongside the Russian club, Benfica and Barcelona.
But now Lennon and his players can look forward to the Champions League resuming in February, while getting back to defending their Clydesdale Bank Premier League title.