St Mirren made up for their disappointment at not making the Premiership top six by returning to Hamilton and booking their place in the fourth round of the Scottish Cup with a 3-0 victory.
Both teams made two changes from their previous meeting. Hamilton brought in Ronan Hughes and David Moyo for Ben Stirling and Callum Smith, while St Mirren replaced Richard Tait and Kyle McAllister with Dylan Connolly and Ethan Erhahon.
Ilkay Durmus fed McGrath and the Irishman lifted the ball over Ryan Fulton and into the far corner of the net.
Another McGrath turn and shot was well gathered by Fulton before Hamilton looked for a penalty when Durmus and Anderson collided in the box.
Durmus then threatened at the other end with a flashing free-kick that drifted just wide of the target.
Accies survived that pressure and created an opportunity of their own through Lee Hodson. But the former St Mirren defender's thrash on goal was brilliantly tipped over by Alnwick.
Hamilton should have drawn level early in the second half. Callachan crossed to the back post where Moyo headed over from an unmarked position.
Aaron Martin then headed into the goalkeeper's hands from a corner as Accies kept up the pressure.
St Mirren welcomed back Dennis off the bench two months after fears that an Achilles injury would keep him out of the rest of the season.
And it was not long before he was making his mark, fastening on to Obika's lay-off before firing a shot into the top corner from around 25 yards.
A third goal followed not long after. Obika was tripped by Fulton and McGrath stroked him the penalty for his 13th goal of the season.