Neil Lennon’s men recorded a first away win in the group stages of the Champions League for the Parkhead club.
Celtic striker Gary Hooper gave visitors the lead in the 12th minute before Emmanuel Emenike netted twice for the Russian club, once either side of the break.
Spartak defender Juan Insaurralde was sent off just after the hour mark for preventing Hooper going clean through on goal.
Celtic levelled in the 72nd minute after a drive from substitute James Forrest, who had replaced Victor Wanyama, deflected in off Spartak captain Dmitri Kombarov and to cap a remarkable night for the visitors Samaras headed in an Emilio Izaguirre cross seconds after the regulation 90 minutes.
Celtic face a double-header against section favourites Barcelona and must go into both games with confidence.
The Parkhead men had drawn 1-1 with Spartak on their artificial turf in a Champions League play-off game in 2007 but this time they went one better and it was Samaras who came up with the goods.
There was little surprise when the Greece striker returned to the Celtic starting XI, with Forrest starting on the bench.
The Hoops striker, a favourite of Lennon, made a substitute appearance in the 2-0 Scottish Premier League win over Motherwell on Saturday after recovering from an elbow injury.
Former Hoops wide-man Aiden McGeady returned to the Spartak midfield after being rested for the 3-1 league win over Amkar.
The home side forced three corners in the first three minutes, a spell of pressure ending when midfielder Kim Kallstrom barged his way into the Celtic box before firing high over the bar.
Spartak had lost the services of keeper Andriy Dykan to injury, his place taken by Sergei Pesyakov.
The number two keeper, though, had little chance with Hooper’s well-taken goal, which stemmed from Kallstrom’s reticence in a 50-50 tackle with Wanyama.
The powerful Hoops midfielder played the ball wide to right-back Mikael Lustig to deliver low for the former Scunthorpe striker to clip the ball in from around six yards.
The Scottish champions retained a threat going forward and in the 24th minute Hooper had the ball in the Spartak net again, this time with a header from a Samaras cross, only to see the flag up for offside.
In the 34th minute, Emenike got on the end of a Evgeni Makeev cross but headed high over the bar from 10 yards.
Moments later, Samaras had a decent chance when Kris Commons flighted a free-kick on to his head but the big Greek failed to make good contact and Pesyakov gathered.
Celtic keeper Fraser Forster had his first real save to make, and a decent one at that, from defender Nicolas Pareja’s curling free-kick from 25 yards.
It looked like Lennon’s side would take a lead into the interval but four minutes from the break Emenike knocked the ball past Forster from close range after being set up by Ari, who had latched on to a delightful long ball by Kallstrom.
Emenike grabbed his second goal three minutes into the second period.
Forster looked slow going down to deal with Ari’s drive from long distance and when he spilled it, Demy de Zeeuw pounced to play the ball across goal for the Nigeria striker to tap in.
It looked a difficult task for Celtic but they had a chance to level in the 58th minute when Charlie Mulgrew’s free-kick from the right found the head of stopper Efe Ambrose but he missed the target.
There was some needless controversy surrounding Insaurralde’s dismissal.
The Spartak defender hauled Hooper back as he raced through on goal from Mulgrew’s pass but at first French referee Tony Chapron played on, then, after presumably taking some instruction from one of his officials, he showed the Argentinian the red card.
Mulgrew’s free-kick, when it was eventually taken, was punched away by Pesyakov, who dealt comfortably with Emilio Izaguirre’s volley from the rebound.
But there was more drama to come in the 72nd minute when Forrest’s angled shot from 12 yards, after good work from Samaras and Hooper, was saved by Pesyakov before going in off Kombarov.
Pesyakov made a good fingertip save from Joe Ledley, who had replaced Mulgrew, and the keeper saved again from Hooper.
But with the game in added time, Samaras rose to head Izaguirre’s cross into the far corner of the net.