In a dramatic Scottish Premiership encounter at a wet McDiarmid Park, St Johnstone lost centre-back Steven Anderson to a controversial red card for a last-man foul and saw Murray Davidson suffer what looked like a serious injury to his left knee, which saw him taken away in an ambulance at half-time.
But May scored either side of the break, the first from one of two contentious penalties given against Kevin McHattie, with his treble coming from the spot soon after Dale Carrick had pulled one back.
Saints goalkeeper Alan Mannus and Hearts forward Ryan Stevenson were sent off in a mass last-minute brawl during a scramble for the ball after Sam Nicholson had scored, and Wilson soon headed Kevin McHattie's corner past makeshift keeper Tam Scobbie.
The action was incessant and started early when May's volley was blocked in a crowded goalmouth before Davidson's backheel was saved by Jamie MacDonald.
Saints were reduced to 10 men in the 21st minute after gifting Hearts possession following their own throw-in the opposition half.
Gary McDonald had the chance to pass the ball inside to Chris Millar but delayed and his pass further back was intercepted. Carrick skipped past Anderson but was 35 yards out on the right and appeared to be heading for the corner flag when he was tripped, but referee Brian Colvin surprisingly produced a red card.
Saints carried a greater attacking threat despite replacing winger Lee Croft with defender Gary Miller, but they suffered another major blow.
Davidson landed awkwardly after leaping high in the air in a bid to head a goal kick and immediately signalled to the bench that he was in real pain. The physios did not take long to determine the injury was serious enough to warrant a stretcher and David Wotherspoon came on.
However, the home side got a break when McHattie was penalised for a pull on the shirt of Nigel Hasselbaink as the Dutchman tried to turn him just inside the box. Assistant referee Michael Banks flagged and Colvin pointed to the spot, to the disgust of the left-back.
May sent MacDonald the wrong way with his powerful spot-kick to give Saints a 39th-minute lead and he was celebrating again less than four minutes into the second half.
Hasselbaink was allowed to turn with the ball 10 yards inside the Hearts half and May was quickly away to latch on to his through-ball and go head to head with MacDonald.
MacDonald stopped his stabbed effort but May won the ball back in a challenge and just managed to scramble the ball over the line, despite his slip in the six-yard box and the efforts of Wilson and Brad McKay to clear.
Carrick headed home his first Hearts goal when he met McHattie's cross from five yards following a half-cleared corner in the 59th minute but the lifeline only lasted four minutes before McHattie fell foul of another linesman.
May tried to flick the ball over his head, again just inside the box, and the flag went up for handball despite the left-back's claim that it had hit his chest.
Again Colvin pointed to the spot and May sent MacDonald the wrong way despite hitting the opposite corner.
Hearts had only scored two goals in their previous seven matches but they piled forward and Mannus saved from McKay, Nicholson and Carrick before Nicholson forced the ball home from close range, sparking a major struggle which ended with the two red cards.
Callum Paterson headed off the bar as Hearts pressed, but there was still time for defender Wilson to spark wild celebrations with his 91st-minute header.