Alan Stubbs had been hoping to make a good impression on his first home outing as Saints boss, but goals from Jason Stevens and Scott Maxwell early in either half gave the Lowland League champions a shock lead.
St Mirren skipper Stephen McGinn pulled a goal back just after the hour mark and a Danny Mullen penalty sealed a 2-2 draw, with the Buddies – who opened their Group H campaign with a spot-kick bonus point after a 0-0 draw at Kilmarnock – going on to claim another extra point as Blair Atkinson proved to be Spartans’ fall guy.
Spartans travelled west without boss Dougie Samuel after he suffered a heart attack last week.
The part-timers’ chief has since been given the all-clear to leave hospital and his side did their best to hand him a get-well-soon gift as they grabbed a surprise opener.
With only six minutes on the clock, Stevens and Jack Smith combined on the edge of the Saints’ box. The Buddies’ defence stopped playing when linesman David Burns raised his flag for offside but referee Alan Newlands overruled him and Stevens ran on to ram a deflected strike past debutant keeper Danny Rogers.
Things went from bad to worse for Saints 10 minutes into the second half when on-loan Aberdeen goalie Rogers raced off his line to clear a Jack Smith through-ball, only to see Maxwell knock it back over his head into the empty net.
Stubbs sent on the rested McGinn, who gave his side an instant lifeline by rifling home in the 59th minute from a Jeff King corner.
Hayden Coulson almost levelled when he rattled the crossbar with a free-kick and the hosts did equalise with 15 minutes left when Mullen scored from the spot after Michael Herd fouled Ryan Flynn.
Spartans’ keeper Blair Carswell made several great saves late on but could not get near any of the Buddies’ spot-kicks as his side lost out 5-3 following Atkinson’s wild miss.