Scott Brown fired the Hoops into the lead from the spot in the 26th minute after Bairns skipper Darren Dods had wrestled with Thomas Rogne at a corner and it looked like the SPL leaders would go on to win with some ease.
However, 17-year-old Falkirk midfielder Jay Fulton, son of former Celtic player Stevie Fulton, levelled for the First Division side before the break.
But there was to be no repeat of Celtic's shock 2010 Scottish Cup semi-final defeat to First Division Ross County thanks to Stokes, who used to play for Falkirk.
The Irishman's free-kick from 25 yards in the 56th minute gave Michael McGovern no chance and he tapped in from a Gary Hooper pass with five minutes remaining to make sure Celtic return to the national stadium on March 18.
Celtic were not at their best for long spells but their treble hopes remain alive with their next game in the William Hill Scottish Cup at Inverness next week.
Falkirk will continue their chase of Division One leaders Ross County and they can take plenty of positives from their performance.
Celtic went into the game having won 12 successive SPL matches on their way to the top of the table.
Steven Pressley's side had knocked out Rangers and Dundee United on their way to Hampden and they started brightly and with a confidence not often displayed by SPL teams when faced with Celtic.
However, in the 11th minute the Bairns were let off the hook with what appeared to be a contentious offside decision in their favour.
Brown's right-footed drive from the edge of the box was tipped onto the post by Bairns keeper McGovern before Hooper rattled the rebound in to the net, only to turn and see the flag up.
Then, from a Charlie Mulgrew corner, Rogne crashed a header off the post, which perhaps led Dods get too close in the 26th minute when referee Euan Norris pointed to the spot and booked the Bairns skipper for wrestling Rogne to the ground at a Mulgrew corner.
There was little cause for complaint from Pressley's side and Brown, who had scored last week at St Mirren, stepped up to slam the penalty past McGovern.
Celtic looked comfortable but there was even more drama in the 39th minute when Fulton drew Falkirk level with a fine goal.
Midfielder David Weatherston turned inside Celtic defender Cha Du-ri on the left and passed inside to Kallum Higginbotham who switched to Fulton who was running in to the box and he knocked the ball low past Fraser Forster before taking the cheers of the jubilant Bairns fans and his team-mates.
The Parkhead side were stunned but with seconds remaining of the first period remaining McGovern came to Falkirk's rescue with a great point-blank save from James Forrest.
After remonstrating with Norris at the end of the first half about the penalty decision, Pressley found himself watching the second-half from the stand where he squirmed in frustration.
Emilio Izaguirre, who was missing at Falkirk's goal, was replaced at the interval by Ki Sung-yueng with Victor Wanyama moving to centre-back and Mulgrew moving go to left-back.
Five minutes after the break Fulton had another chance when Higginbotham stood the ball up at the back post but this time, from 10 yards out, the midfielder bounced his shot over the bar.
In the 55th minute Rogne hit woodwork again, crashing a close-range shot off the bar from a Mulgrew corner which the Bairns had failed to deal with properly.
However, that only delayed the Hoops' second goal which came a minute later when striker Anthony Stokes curled a wonderful free-kick from 25 yards over the defensive wall and past the helpless McGovern.
With that goal, Celtic regained their grip on the game and on the hour mark Ki had a powerful drive from 30 yards which was gathered by the Bairns keeper.
Falkirk substitute Blair Alston, who had replaced Fulton, drove wide from inside the box as the game began swinging from end to end.
With one goal in it and Higginbotham at the top of his game, the First Division side always had a chance and in the 78th minute Forster made a fine double save following a corner, first from Dods and then from Stewart Murdoch.
However, there was to be no shock and in the 85th minute Celtic's final appointment was booked when Hooper got away from Dods on the right-hand side of the box and set up Stokes who knocked in from barely a yard out.