An epic third round tie remained 2-2 after 90 minutes and 3-3 after extra-time with Hearts eventually triumphing 4-2 on spot-kicks.
Hearts also needed penalties to overcome Raith Rovers in the last round.
Kevin McHattie had fired the Jambos into the lead but his opener was cancelled out by Ryan McGuffie, with the scoreline level at half-time.
The Edinburgh side nudged in front again through a Hamill penalty only for Paton to haul Queens back in the match and force the third round tie into extra-time.
Danny Wilson then netted just two minutes later but, unbelievably, the visitors restored parity again thanks to Chris Higgins.
The on-loan striker from Blackburn took advantage of a slip by Thistle defender Conrad Balatoni in the 33rd minute to open the scoring with a shot from 10 yards before he grabbed his second with a header.
The United defence found themselves having to defend more than they would like before they asserted themselves to find a third in the 85th minute through substitute Ryan Dow.
Christie Elliott scored a consolation for the visitors in the final minute but Goodwillie was not to be denied the match ball by scoring from a Stuart Armstrong pass as United ran out comfortable winners.
Scott Vernon's second-half hat-trick helped ensure Aberdeen did not suffer another embarrassing choke against lower-league opposition as Falkirk were swept aside 5-0.
Joe Shaugnessy had given the Reds a 22nd-minute lead while Cammy Smith added a second nine minutes before the break as Derek McInnes' team made a positive start to the third-round clash.
And they sealed their place in the League Cup quarter-finals with Vernon's treble as a comprehensive 5-0 success was wrapped up.
James McFadden scored with a backheel to secure Motherwell's passage into the Scottish Communties League Cup quarter-finals with a 2-1 win over 10-man Livingston.
Bob McHugh had opened the scoring on 15 minutes when he headed home from close range following a well-worked set-piece.
Livi saw defender Jason Talbot sent off in the 65th minute for a challenge on Stevie Hammell.
Hammell's cross was then driven back across goal by Lionel Ainsworth and the Scotland forward flicked the ball into the far corner from six yards for his first goal of the season.
Livi scored with their first shot on target in injury-time when substitute Danny Denholm bundled home Martin Scott's corner but Motherwell had no more scares.
- Sports & Recreation
- Michael Paton
- Jamie Hamill
- Dundee United
- David Goodwillie
- Raith Rovers