Trailing 2-0 from the first leg, Celtic saw early headers from Mikael Lustig and Anthony Stokes superbly saved by Alexsandr Mokin.
But Kris Commons netted the vital opener with a fine strike in first-half injury time to settle the nerves and Georgios Samaras added a second three minutes after the break to level the tie.
With the prospect of extra-time looming, Forrest scored after good work from Stokes to send Celtic Park wild and ensure Neil Lennon’s side are in Thursday’s group stage draw.
The night started on a positive note for the Scottish champions.
Lennon was boosted by the return of Commons, Samaras, Stokes and Forrest who had all recovered from their respective injuries.
However, the Northern Irishman revealed a reshuffled central defence with full-back Lustig partnering Efe Ambrose, with Adam Matthews and Charlie Mulgrew at right and left-back respectively.
In the fifth minute of a frantic, fiery opening, Mokin made a great save from Lustig’s close-range header following a perfect cross by Commons.
The visitors escaped the subsequent corner but their rearguard action had only just begun.
Five minutes later Stokes made a good run to take a clever Commons pass inside the box and rounded the keeper but defender Nikola Vasiljevic turned the Irishman’s cut-back away for a corner, quickly taken, from which Mokin tipped Forrest’s drive over the bar.
The visitors survived again but the green and white tide refused to be kept at bay.
Stokes’ header from a Forrest cross drew another good save from Mokin before the keeper turned away a vicious Commons free-kick from out wide.
Shakhter posed a real threat for the first time in the 27th minute when skipper Andrei Finonchenko floated a free-kick to the back post where Vasiljevic rose to head back across and fellow defender Aldin Dzidic headed over.
Six minutes before the break the visitors broke forward again and Lustig had to block a shot from Shakhter striker Sergei Khizhnichenko, as the home fans breathed a sigh of relief.
That relief turned to joy when Commons’ powerful drive just before the end of the first half changed the complexion of the game, which altered completely three minutes into the second half when Samaras levelled.
Shakhter failed to properly clear their lines following another corner and Lustig’s drive from outside the box fell kindly to the Greek striker, who quickly swept the ball past Mokin.
Celtic continued to pile on the pressure with Stokes hitting the bar with a volley from 10 yards after being set up by Forrest.
There was a heart-stopping moment for Celtic soon afterwards, following a Shakhter corner, when Hoops right-back Matthews had to clear a Dzidic header off the line with keeper Fraser Forster out of his goal.
Seconds later, from Gedinimas Vicius’ long throw, one of the main Kazakh weapons, the Hoops defence were in trouble, escaping when Khizhnichenko’s flick from six yards hit the crossbar before flying to safety.
The game took a well-deserved, if brief, breather.
For the first time Shakhter began pushing forward with some purpose if little guile but it looked as if the Parkhead side had at least one more goal in them.
As the game edged towards extra-time the tension mounted.
Dutch forward Derk Boerrigter replaced Commons in the 79th minute as Celtic stepped up their efforts for the winning goal.
It looked, however, as if the game was going into extra time until Stokes drove into the box and set up Forrest for the most dramatic and lucrative winner.