The hosts had arguably the better of the opening 79 minutes before the game burst into life when Hibs conceded a penalty, which substitute Nigel Hasselbaink saw saved by goalkeeper Ben Williams.
Saints boss Steve Lomas was sent to the stand by referee Craig Thomson soon afterward and Paul Cairney netted the winner after 82 minutes. David Robertson was taken off on a stretcher and Saints captain Dave Mackay was shown a straight red card for an altercation with Leigh Griffiths in stoppage time as the hosts' misery was complete.
Seventeen minutes elapsed before the first shot on goal when Hibs striker Eoin Doyle curled over the bar. Rowan Vine shot weakly at Williams before David Wotherspoon attempted to spark proceedings with a neat one-two with Griffiths, only for the return pass to bounce off his knee.
Mackay's free-kick deflected over before Gregory Tade barged by Ryan McGivern and Lewis Stevenson on the right and crossed low for Steven MacLean, whose effort was blocked by Alan Maybury.
Liam Craig hit a left-footed free-kick from 25 yards after Paul Hanlon had brought down Tade and it took a slight deflection before bouncing back off the crossbar. Then Craig, on the left, found MacLean, who evaded Stevenson's lunge to shoot low, but too close to the goalkeeper as Williams saved.
Williams scrambled the ball away from the feet of MacLean, but Hibs failed to clear and as Mackay moved into the box he was tripped by Wotherspoon.
The Hibs goalkeeper saved Hasselbaink's resulting spot-kick and the follow-up from Craig before Lomas' frustrations boiled over and he was dismissed from the touchline.
Moments later Saints went behind as the ball broke for Cairney in the centre of the area and he was able to prod in beyond Alan Mannus.
Robertson departed on a stretcher following a tackle in midfield and there was a dispute between Mackay and Griffiths, whom the Saints captain felt had chased down the ball which had been returned to the hosts. Mackay was shown a red card as the frenzied finale finished on a sour note for Saints.