The visitors had won on the road for the first time this year at Tynecastle in their last appearance and added to that with another win that lifts them up to ninth in the table.
Hamilton were the better team for most of the game, with Mickel Miller their best player on the day, but could not create enough in front of goal.
It was a scrappy start with few chances for either side. Kane had the first opportunity for the visitors but headed over the bar, while Miller had Accies' first chance but dragged his shot wide.
Miller then turned provider by teeing up George Oakley but the forward was wasteful with the chance and failed to trouble Zander Clark in the Saints goal.
Accies continued to create the best opportunities in a scrappy game. Miller threatened again with a shot from Moyo's lay-off but blazed it over the bar.
St Johnstone were struggling to fashion anything of note. They finally created another half-chance five minutes before the interval but Brian Easton was well positioned to block May's shot.
May threatened again shortly after the restart but after being teed up by Callum Booth, the former Aberdeen striker's effort sailed well off target.
The impressive Miller – a rare bright spot in an otherwise tedious encounter – had another chance for Accies but flashed his shot into the side netting.
St Johnstone appealed for a penalty when substitute Hendry's shot struck Sam Stubbs on the arm but referee Gavin Duncan was not interested.
But the visitors did make the breakthrough after 80 minutes. Hendry cut the ball back from the goal line and McCann finished from close range for his first St Johnstone goal.
Substitute Davies had one late chance for Accies but was unable to get his free-kick on target.