The Scottish Premiership side were taken to extra time but despite seeing Paul McGowan miss a penalty, they kept their composure to take the lead with Steven Thompson's header on 95 minutes.
However, their second-tier opponents fought back with Stephen McKenna's fabulous leveller before Paton pinched the win five minutes from time.
Last year's competition saw the Paisley side stun Celtic in the semi-final before breaking Hearts at Hampden with a 3-2 victory to claim their first major trophy in 26 years.
But Danny Lennon's men headed to Dumfries in worrying form after backing up that March triumph with just one win in the six months that followed.
Their lethargy was evident as Queen's energetic pressing caused them all sorts of problems in the opening period.
While Saints struggled to link up, the hosts were menacing, with Derek Lyle the first to threaten when he fired half a foot over David Cornell's crossbar after just six minutes.
McKenna then sprayed a ball left for Daniel Carmichael to catch but the sprightly winger send his shot wide after cutting past David van Zanten.
A lapse in concentration from St Mirren's Gary Teale let in Paton to fire off a shot which Cornell did well to beat away, before Saints finally conjured an attempt on goal on the stroke of half-time as Gary Harkins strode forward from his own half, shrugging off Paton's attempt at a tackle as he went, before thudding the upright from 20 yards out.
The Buddies started the second half in more confident fashion, with John McGinn watching Calum Antell deny his long-range effort.
With 10 minutes left, Harkins then found the side-netting after Teale's driving run and cross but Queens held out for extra-time.
And there was drama just three minutes into the additional period as Thompson was felled by Paton in the box, only for Antell to deny substitute McGowan's spot-kick.
Saints did not let that blow distract them and as Harkins crossed for Thompson just two minutes later, the former Scotland striker found the net with a downward header.
But Queens responded when McKenna sent a 20-yard screamer past Cornell three minutes before the turn-around to level the match once again.
And Saints' reign as champions was ended five minutes from time when Antell's long punt was misjudged by St Mirren skipper Jim Goodwin, opening the space for Paton to steer a clever lob beyond the stranded Cornell.
Hearts made nervy progress through to the third round of the Scottish League Cup as they beat Raith 5-4 on penalties in a tense Stark's Park clash, which was tied at 1-1 after extra time.
Defender Brad McKay notched the decisive spot-kick after Ross Callachan saw his effort saved by substitute goalkeeper Mark Ridgers.
Championship side Raith had taken the lead in the 50th minute when Liam Fox drove a shot into the net after a Calum Elliot run into the area caused panic.
But Jamie Hamill netted from the spot 12 minutes later and was involved in the incident that led to Raith's Dougie Hill being red-carded in the 74th minute, before the high drama of penalties settled the issue.
Following a scrappy start, Hearts midfielder Jason Holt registered a shot on target after six minutes when his low drive from 25 yards forced David McGurn into a smart save.
Raith striker Elliot then had appeals for a penalty waved away by referee Brian Colvin after tumbling in the box with Hamill in hot pursuit.
Kevin McHattie picked up a yellow card for a late challenge on Grant Anderson, and from a Callum Booth set-piece defender Douglas Hill nodded over the bar.
Jamie MacDonald got down well to a left-footed Joe Cardle effort at the near post after 22 minutes but it proved to be the Hearts goalkeeper's last piece of action. The shot-stopper limped off moments later and was replaced by Ridgers.
The substitute goalkeeper was called into action moments before the break to make a diving save to palm away a rising Elliot drive from 30 yards.
Raith were on the front foot at the start of the second half and went ahead through Fox.
A dangerous Elliot run into the box caused panic and Ridgers produced a great save to block a Gordon Smith shot from close range but Fox found a gap in a congested box to fire a left-footed effort into the net.
Hearts equalised from the penalty spot in the 62nd minute after Jason Thomson brought down Billy King inside the area.
Hamill stepped up and sent McGurn the wrong way from 12 yards with a low shot.
The Hearts midfielder was involved again as Raith were reduced to 10 men in the 74th minute after Hill was shown a straight red card for appearing to heat-butt Hamill.
Extra-time came and went without either team managing to break the deadlock. Hearts twice wasted the chance to settle the tie on penalties when Holt and David Smith failed to convert but McKay finally won it in sudden death.
Partick made hard work of seeing off Scottish Championship bottom side Cowdenbeath as substitutes Christie Elliot and Steven Lawless helped them to a 3-1 victory in the Scottish League Cup second round.
Thistle needed a Scott Fox penalty save to send the game into extra-time and their frustration grew when Kane Hemmings cancelled out Elliot's opener within 90 seconds.
But Lawless finished well and Aaron Muirhead settled the issue from the penalty spot. Thistle had survived a couple of early scares before the first half settled into a rhythm of the hosts knocking the ball about inside the opposition half but rarely getting in behind or round the outside of a packed Cowdenbeath defence.
Striker John Baird was often lacking in support and he had Thistle's best first-half effort when he met Stephen O'Donnell's cross first time from 12 yards but Grant Adam got down well to hold.
Baird had a better chance two minutes after the break when James Craigen's flick put him through but Adam blocked his powerful strike.
Cowdenbeath left-back Kenny Adamson gave his side the perfect chance to take the lead in the 55th minute when he shimmied past one man before wrong footing Muirhead, who stuck out a foot and tripped him up inside the box.
Jamie Stevenson slowed down his run-up but Fox dived low to his right to push the midfielder's spot-kick wide. Lawless and Kris Doolan came on but Thistle still struggled to create clear chances before putting more pressure on as the 90 minutes progressed.
Baird went down in the box under pressure from Nathaniel Wedderburn in injury-time but referee John McKendrick booked him for diving and there was still time for Adam to block Doolan's shot.
Another substitute, Elliott, finally broke the deadlock two minutes into extra-time when he angled a shot inside the far post after being set up by Lawless inside the box.
But Cowdenbeath went straight up the park and levelled when Hemmings burst into the box following a powerful run and shot low into the corner.
The former Rangers forward then saw a shot brilliantly saved by Fox after a one-two with Jordan Morton and John Armstrong headed wide from the resulting corner.
Gabriel Piccolo blazed over following a corner at the other end but Thistle found the net in the 103rd minute when Doolan's lay-off fell to Lawless and the former Motherwell man fired low into the bottom corner.
Fox saved a powerful Hemmings strike and Thistle wrapped up the win with six minutes left when Muirhead sent Adam the wrong way after Morton had brought down Lawless just inside the box.
Scottish League Cup results:
Morton 4 - 0 Montrose
Stranraer 3 - 2 Ross County
Aberdeen * 0 - 0 Alloa Athletic (Aberdeen win 6-5 on penalties)
Airdrieonians 0 - 2 Livingston
Dundee FC 2 - 1 Forfar Athletic
Falkirk 2 - 1 Dunfermline Athletic
Kilmarnock 0 - 1 Hamilton Academical
Partick Thistle 3 - 1 Cowdenbeath
Queen of South 2 - 1 St. Mirren
Raith Rovers 1 - 1 Hearts * (Hearts win 5-4 on penalties)