Dundee picked up their first win of the newly-formatted competition, with Stewart and Kane Hemmings picking up where they left off last season.
Stewart curled in a free-kick after 16 minutes but Dumbarton replied through strikes from Frazer Wright and Gregor Buchanan.
Dundee equalised three minutes after the break as Stewart and Rory Loy combined prior to Hemmings beating Mark Brown.
Darren O’Dea’s 73rd-minute header put the hosts back in front and Stewart made it 4-2 a minute later, before completing his hat-trick with 10 minutes left.
Hemmings completed the rout with five minutes remaining with another calm finish from six yards from Kevin Holt’s pass.