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.
Parkhead was braced for another night of European excitement and it did not disappoint.
The Scottish champions went in to the game knowing they would qualify for the knockout stages only if they got a better result against Spartak, consigned to the bottom of the table, than Benfica got in the Nou Camp.
All the big guns were back for Celtic's most important game of the season.
Fraser Forster, Kelvin Wilson, Commons, Hooper and Samaras were five of the nine changes the Hoops boss made to the makeshift team which started in the 1-1 home William Hill Scottish Cup fourth-round draw against Arbroath on Saturday, with midfielder Victor Wanyama suspended.
Spartak had former Celtic midfielder Aiden McGeady on the bench with Emenike leading the line.
Backed by around 1000 fans, the visitors had the better of the early exchanges.
In the 12th minute visiting captain Dmitri Kombarov's cross from the left almost found the lively Emenike before the Hoops defence eventually got the ball to safety.
Four minutes later Kallstrom played a smart one-two with Artem Dzyuba before curling a left-footed shot from 25 yards just past Forster's right post.
The Moscow club only had themselves to blame for falling behind when they were on top.
Insaurralde, who had been sent off against Celtic in their earlier meeting in Russia for a professional foul on Hooper, attempted to cut out a through ball from Samaras which looked to be heading through to keeper Sergei Pesyakov.
The hapless defender succeeded only in taking the sting out of the ball, allowing the former Scunthorpe striker to drill the ball low into the corner from outside the box.
With the home fans still celebrating their good fortune Emenike sped away from Celtic defender Efe Ambrose, but his shot from the edge of the area flew wide.
Just after the half-hour mark, with the Russian club edging the game while looking vulnerable when Celtic moved forward, Commons drove wide of the target from the edge of the box after the Spartak defence had failed to properly clear a Charlie Mulgrew corner.
As play swept from end to end, Hoops skipper Scott Brown had a first-time effort from 16 yards saved by Pesyakov but Spartak's equaliser, when it came, was well deserved.
Emenike's strength allowed him to bounce his way through several attempted tackles before he laid the ball wide to Ari whose chip beat Forster and the backtracking Wilson could only help the ball into his own net.
The second half promised to be nerve-ridden but Celtic started with purpose and in the 50th minute Samaras came close with an effort which struck the post.
McGeady got a round of applause from both sets of supporters when he replaced Ari just after the hour but all the while the home fans had one eye on the score from the Nou Camp.
Celtic were allowing Spartak plenty of possession in their own half and the game took a breather before bracing itself for a frantic finale.
In the 72nd minute Ambrose headed a Commons corner into the side-netting with some Hoops fans thinking the ball had gone in.
Adam Matthews replaced the injured right-back Mikael Lustig while striker Lassad Nouioui came on for midfielder Beram Kayal before Pesyakov tipped Mulgrew's goal-bound header from a Commons corner over the bar for another corner, which came to nothing.
In the 80th minute Celtic were handed their lifeline when Suchy barged Samaras in the box and Commons hammered the ball high past Pesyakov and in off the bar.
Still, the result from Barcelona remained crucial, although that was to finish goalless.
After Kallstrom was dismissed, Commons' departure meant Celtic, who had used all their substitutes, playing five minutes added time also with 10 men but it was to be a night of glory for the Parkhead men.
CELTIC v SPARTAK MOSCOW PLAYER RATINGS
FRASER FORSTER - The goalkeeper, who has played so well throughout the Champions League campaign, had a quiet night. Left exposed as Ferreira Ari chipped him for Spartak's goal and made one comfortable save in the second half. 6
EMILIO IZAGUIRRE - Went missing as Ari was given acres of space to equalise for Spartak but linked with Samaras in the second half. 6
MIKAEL LUSTIG - Continuously got forward down the right and won a number of corners, coped well defensively. 7
KELVIN WILSON - Given a difficult game by Emmanuel Emenike and could only help the ball on its way as he chased back Ari's chip. 6
EFE AMBROSE - Composed start as others around him seemed nervous, but outmuscled by his fellow Nigerian Emenike as he threatened throughout. 6
BERAM KAYAL - Came in for the suspended Victor Wanyama and despite lacking the strength of the Kenyan closed down the midfield to good effect. 6
SCOTT BROWN - A captain's performance as he showed no signs of his long-standing hip injury in covering the entire pitch and taking on a more attacking role. 8
CHARLIE MULGREW - Excitement rose in the stadium every time Celtic won a corner but Mulgrew did not deliver the inviting crosses that have led to so many of Celtic's European goals. 6
KRIS COMMONS - Kept his cool to smash the decisive penalty straight down the middle and in off the bar to send the home fans into a frenzy. Later carried off on a stretcher after a reckless Kallstrom tackle. 7
GEORGIOS SAMARAS - Hit the post and won the penalty as he drove Celtic forward in the second half after a subdued opening period. Tried to take on one player too many with his trademark mazy runs. 8
GARY HOOPER - Clinical finish as he capitalised on Juan Insaurralde's mistake to fire Celtic ahead but remained largely isolated up front after his goal. 7
ADAM MATTHEWS (for Lustig, 71 minutes) - Little chance to make an impression. 4
LASSAD NOUIOUI (for Kayal, 73) - Brought on as Celtic searched for a goal and held the ball up well. 5
JOE LEDLEY (for Brown, 84) - Came on as the captain tired and shored up the midfield. 4
COMMENT RULES: Comments that are judged to be defamatory, abusive or in bad taste are not acceptable and contributors who consistently fall below certain criteria will be permanently blacklisted. The moderator will not enter into debate with individual contributors and the moderator’s decision is final. It is Belfast Telegraph policy to close comments on court cases, tribunals and active legal investigations. We may also close comments on articles which are being targeted for abuse. Problems with commenting? firstname.lastname@example.org