The Scottish Premiership side had been held to a 2-2 draw at Palmerston Park last month, but had a comfortable time in the fourth-round replay at home in Paisley on Tuesday.
Harkins and McLean both had decent chances in quick succession in the subsequent minutes before John McGinn headed wide from just yards out.
St Mirren dominated the rest of the first half with McLean's header being saved by Queen of the South goalkeeper Alexander Clark, but they survived a scare on 40 minutes when Derek Lyle's long-range effort hit the crossbar.
The visitors were denied by the frame of the goal again 10 minutes into the second period when Iain Russell's shot from outside the box came back off the crossbar.
St Mirren virtually ascertained the win in the 74th minute when Thompson found the target after latching onto a deflected shot from Marc McAusland.