Ivory Coast defender Sol Bamba, restored after returning from the African Nations Cup, also put through his own net early on to gift the Buddies the lead.
Former Celtic midfielder Liam Miller equalised with his second of the season, before Hibs finally struck two minutes into stoppage time to remain two points behind second-placed Celtic.
On a tricky, crusty pitch which made passing play difficult, Hibs appeared unsettled for long periods but they fought to the end as battling St Mirren fell to a fourth straight defeat.
John Hughes made one change from the 2-1 success at Parkhead in midweek, bringing in Bamba for Paul Hanlon.
Lee Mair and Steven Robb came in for Gus MacPherson's side, with Andy Dorman and Chris Innes dropping out.
Hibs have tended to slip up immediately after triumphs in Glasgow in recent years and they almost fell behind after two minutes.
A quick corner from Ross caught Hibs cold and Garry Brady picked out Billy Mehmet in the six-yard box.
The striker should have buried the free header, but Graeme Smith made a fantastic point-black save and Hugh Murray could only knock the rebound over.
But a strangely out-of-sorts Hibs were soon the architects over their own downfall as Bamba handed the visitors a ninth-minute lead to mark a forgettable return to action.
The defender, who only flew back to Edinburgh this week after over a month away, sought to cut out Robb's deep cross from the left but his outstretched leg diverted the ball past a stranded Smith.
Worse almost followed for the hosts four minutes later when Brady's back-post cross was headed down by Michael Higdon to Mehmet who fired just wide.
On a poor surface, Hibs were struggling to find any kind of passing rhythm.
Yet, on 25 minutes, St Mirren were lucky to survive. A corner from John Rankin forced an almighty goalmouth scramble which saw Gallacher somehow claw away from Bamba on his goal-line, before the defender fired wide. Another Rankin centre picked out Coin Nish who headed tamely past.
Finally, Hibs were growing into the contest and in the 33rd minute the equaliser came.
Rankin's lofted ball into the penalty area saw Nish contest with Mair, allowing Miller to burst through from midfield and latch on to the loose ball before confidently stroking past Gallacher.
Nish quickly lifted an 18-yard drive over before Bamba atoned for his earlier error as he cut out a neat one-two between Higdon and Mehmet.
Hibs almost grabbed the lead on half-time. David Wotherspoon's cross from the right saw Nish strike the near post before he fired the rebound over.
Hibs had the first opening of the second half with Nish again firing just over from the edge of the penalty area after Stokes' blocked effort had broken into his path.
The Buddies replied with a curling free-kick from Robb which drifted over Smith's bar.
Nish, becoming more influential, then pushed forward and played in Rankin who could only strike straight at Gallacher under pressure.
The match was delicately poised, but Hibs should have led on the hour mark.
Stokes whipped in a cross from the right but Nish again could not find the target as he headed inches wide.
Hughes' charges continued to press and on 70 minutes Mair came to his side's aid, hacking clear from Murray's net-bound header.
St Mirren were being pinned back as the home fans sought to roar on their side to a decisive goal.
Miller thought he had claimed it in the 75th-minute as he latched on to another loose ball only to see Gallacher pull off a stunning save from his fierce volley.
New on-loan Rangers striker Rory Loy made his entrance seconds later as MacPherson sought to stem the tide.
Another Hibs corner soon caused panic and Nish and Derek Riordan failed to force home chances.
Nish flicked a header past again before sub Dorman almost netted with an injury-time chip.
But Hibs refused to give in and two minutes into stoppage time the winner came when Murray's cross was diverted into his own net by Ross.