Liam Henderson and John McGinn had earned the Capital club a two goal lead only for Stevie Mallan to claw one back for the Buddies in added on time at the end of the first half.
But Stokes stepped off the bench and with only a minute remaining was on hand to turn fellow substitute James Keatings’ low cross into the empty net.
Anthony Stokes was on the bench as Alan Stubbs paired Chris Dagnall up front with Jason Cummings, the on-loan Celtic striker joining Dominique Malonga on the bench.
But there was no Dylan McGeouch, Marvin Bartley stepping into midfield with Henderson also restored to the starting line-up at the expense of James Keatings.
Hibs had to survive an early scare as Buddies midfielder Mallan’s free-kick dropped over Mark Oxley’s bar.
But the home side were ahead in the ninth minute. Henderson was fouled by Jack Baird a couple of yards outside Saints penalty area and the midfielder rose to take the free-kick himself, sending a stunning shot high into the far corner of Jamie Langfield’s net, leaving the goalkeeper totally helpless.
Cummings looked to have doubled Hibs lead when he unleashed a vicious drive from 30 yards but Langfield got down to his left just in time to push the ball wide of target after it had taken a wicked bounce in front of him.
And Saints had the right boot of Langfield to thank for preventing Cummings adding a second in the 36th minute. Lewis Stevenson’s searching long ball found his team-mate running in behind the Saints defence but the goalkeeper managed to get his foot to the striker’s low shot.
Langfield was again in action to beat away a powerful shot from former Buddies’ midfielder John McGinn before Oxley was forced to do likewise at the opposite end as Rocco Quinn unleashed a rocket from 30 yards.
But it was Hibs who were carrying the greater threat and Langfield had to look sharp to get down to his right to push away Dagnall’s low effort.
Hibs finally got the second goal they deserved a minute from the interval, McGinn slotting the ball beyond Langfield after a superb move which saw Stevenson, Henderson and Cummings combine to carve open the Paisley defence.
However, two minutes into added on time Marvin Bartley was adjudged to have fouled Lawrence Shankland 20 yards out, leaving Mallan to fire a superb free-kick beyond Oxley.
Hibs would have reflected that they should have been restarting with a greater advantage than just one goal but the second half followed the same pattern as the first, the home side enjoying plenty of possession as they probed away for an opening.
Paul Hanlon got up to get his head to David Gray’s cross forcing Langfield to touch the ball over, Cummings powering a header over from the resulting corner.
Shankland came up with a brilliant goal-line clearance to keep Hanlon’s diving header out as Hibs turned the screw before McGinn’s low angled shot caught the boot of Langfield and spun behind without the goalkeeper knowing too much about it.
Stokes received a rapturous reception from the Hibs support as he replaced Dagnall in the 71st minute for his first appearance since August.
And with his first touch he sent a sumptuous through ball into the path of Fraser Fyvie, the midfielder unfortunately unable to gather it and injuring himself in the process although he was able to continue after treatment.
Saints substitute Jordan Stewart prevented Stokes enjoying a dream start to his second spell at Easter Road, a shot which appeared to be heading for the far corner out of danger.
But the 27-year-old’s big moment was merely delayed, the on-loan Celtic striker in the right place at the right time to turned Keatings cross into the net from a couple of yards out.
Hibs: Oxley, Gray, Hanlon, Fontaine, Stevenson, Bartley, Fyvie, McGinn, Henderson (McGregor 89), Cummings (Keatings 85), Dagnall (Stokes 71).
Substitutes not used: Reguero, Malonga, Boyle, Gunnarsson.
St Mirren: Langfield, Watson, Baird, Webster, Kelly, Gallagher, Quinn, Agnew (Thompson 77), Mallan, Shankland, Howieson (Stewart 71).
Substitutes not used: Wilks, McMullan, Gow, Cuddihy, McAllister.
Referee: Don Robertson.