After Ali Crawford had spurned a great chance for Accies just after the break, the Saints striker scored twice in seven minutes before midfielder Murray Davidson headed in a third to take Tommy Wright’s side level on points with Hearts in fourth place.
Accies’ winless run in the league extends to 12 games and they remain second-bottom of the table above Inverness by one goal.
However, they have cause to wonder what might have happened had Crawford not missed the target with only keeper Zander Clark to beat.
Saints were looking to get back on track following their 1-0 defeat Celtic in midweek and showed six changes with Blair Alston, Murray Davidson, Steven MacLean, Richard Foster and Cummins coming into the side.
The visitors were without centre-backs Michael Devlin, Massimo Donati and Georgios Sarris through suspension, the latter also injured. Danny Seaborne was brought in and Craig Watson made his first start of the season as boss Martin Canning went with three at the back.
However, it was a poor first-half, in keeping with the dreary weather.
On the half-hour mark midfielder Crawford cleared the bar with a dipping free-kick from 30 yards, after Saints’ playmaker Danny Swanson had been booked by referee Nick Walsh for a foul on Danny Redmond.
Six minutes later, as the Lanarkshire side pressed the home side back, Watson fired high over the bar after St Johnstone skipper Steven Anderson had miskicked eight yards from goal.
Hamilton should have taken the lead five minutes after the break when Alex D’Acol sent Crawford racing into the box but with only Clark to beat he slashed his shot from 16 yards high and wide.
That was the turning point as moments later, Accies were behind.
Watson did well to put in a blocking tackle on midfielder Blair Alston at the expense of a corner but when Swanson swung the ball over from the left Cummins rose highest to bullet his header past Gary Woods for his third goal of the season.
There was more joy for the striker on the hour mark when, with the Hamilton defence in disarray, he had time and space to sweep in an Alston cross after Steven MacLean had done the spadework.
Hamilton were stunned and fell further behind when Davidson, 12 yards from goal, climbed to head a Brian Easton cross in off the post and there was no way back for the Lanarkshire side.