May nodded the visitors in front in the fourth minute and added another in added time after on-loan Swansea midfielder Gwion Edwards had helped ensure a place in the fourth round.
Tommy Wright's decision to restore May to his starting line-up paid early dividends when he was on hand to head home after Dave Mackay's ball into the box was nodded back across goal by Steve MacLean.
Hamilton were unlucky not to restore parity moments later when Jon McShane's drive cannoned off the upright, while MacLean could not keep a header down at the other end.
Saints goalkeeper Alan Mannus had his gloves warmed by Ziggy Gordon, and Kevin Cuthbert did well to get a touch to MacLean's shot before May missed the target from a tight angle.
Anthony Andreu sliced wide shortly before the interval, and Nigel Hasselbaink was denied by Cuthbert early in the second half as the visitors asserted their authority.
May and Hasselbaink both lashed at fresh air in a goalmouth scramble, but Hamilton then enjoyed an excellent spell of pressure as Devlin hooked just wide before having a header tipped behind by Mannus.
But Edwards put the result beyond doubt four minutes from time as he pounced on a loose back-pass to stab past Cuthbert.
And May's delightful, curling strike from 25 yards proved an apt way to end the tie as Saints cruised into the quarter-finals.