Joe Shaughnessy netted five minutes into stoppage-time to secure St Mirren a place among the seeded teams in the Premier Sports Cup second round before Hearts fell just short.
The Saints skipper's goal made it 2-0 and ensured they bettered Dundee United's record.
Hearts later had the chance to take their place among the seeds but a 1-0 win over Inverness was insufficient and United retained their spot in the top half of the draw.
Jamie McGrath's first-half penalty had put St Mirren on course to top the group but they left it late to guarantee themselves a place among the seeds.
Thistle had to win by three goals to leapfrog the Buddies and join Dunfermline in progressing from Group G.
But their task became even tougher when McGrath slotted home a 25th-minute spot-kick after Richard Foster had been adjudged to have brought down Jay Henderson.
The Jags responded and Jak Alnwick made saves from Brian Graham and Stuart Bannigan before the break.
But the hosts dominated after the interval. McGrath's shot skimmed the top of the bar before Curtis Main missed a couple of decent chances and Henderson shot straight at the goalkeeper.
Main headed wide from close range in stoppage-time but centre-back Shaughnessy found himself in the six-yard box moments later to tap in Lee Erwin's square ball.
Both St Mirren and Dundee United have identical goal difference records of nine for and one against. But Jim Goodwin's side moved ahead courtesy of scoring more away from home – helped by the award of a 3-0 win at Covid-hit Dumbarton.
But United later joined Saints and city rivals Dundee among the seeds for Sunday evening's draw along with European qualifiers Rangers, Celtic, St Johnstone, Hibernian and Aberdeen.
Hearts had already won their group but needed to win and score at least two goals to better United's record.
Hearts forward Liam Boyce and Armand Gnanduillet had half-chances in the first half while Alex Cochrane pulled off a brilliant block from Tom Walsh's shot at the other end.
The chance of the first half came in the final minute when former Hearts goalkeeper Mark Ridgers made an excellent stop from Finlay Pollock to stop the 17-year-old converting Josh Ginnelly's low cross.
Ridgers saved from Gary Mackay-Steven before Gnanduillet and Pollock both hit the post in quick succession, and the Ivory Coast frontman was denied by the goalkeeper with time beginning to run out.
Jamie Walker came off the bench and lit up the game, taking a Boyce pass in his stride and firing a left-footed drive home from 18 yards in the 75th minute.
The midfielder forced three saves from Ridgers as Hearts pushed for the crucial second and was hacked down by Michael Gardyne in a foul which sparked a straight red card with two minutes left.
Mackay-Steven flashed a shot over on the half volley in the fifth minute of stoppage-time as Hearts just missed out on a seeded spot.