Miller then won a penalty after being caught by Lee Hodson but dragged his effort wide of goal, leaving Hamilton one point above bottom-placed Hearts and three behind St Mirren.
St Mirren made just one switch from the side that drew with Hibernian at the weekend, with Jamie McGrath replacing Jon Obika.
There were five changes in the Hamilton line-up from the team beaten by Celtic. In came Brian Easton, Shaun Want, Johnny Hunt, Miller and Templeton as Jamie Hamilton – sent off on Sunday – Sam Woods, Will Collar, Blair Alston and David Moyo dropped out.
St Mirren started on the front foot but it was Hamilton who had the first real chance when Aaron McGowan's shot was deflected for a corner.
And it was the visitors who went in front after 25 minutes. Templeton was allowed to advance to the edge of the box and his low shot found the corner of the net.
The home side then missed a great chance to draw level when Durmus headed weakly wide after being picked out by Junior Morias.
Templeton then nearly made it 2-0 with a carbon copy of his goal, but this time his driven effort sailed just wide.
And there was a huge let-off for St Mirren when Marios Ogkmpoe unleashed a thunderous shot that cracked against the crossbar.
The home side finally mustered an effort on target in the final minute of the first half but Tony Andreu's shot lacked the power to beat Southwood.
Flynn then teed up Andreu for the home side but his shot was deflected off target when it looked certain that he would score.
Flynn was then brought down on the edge of the box by Miller. And after a lengthy injury stoppage, Durmus curled his set-piece into the top corner.
Miller then had a great chance to win it from the spot in the 77th minute but fluffed his lines.