The Terrors had won their last five Scottish Premiership games but were undone by the visiting Saints, who benefited from an error by home goalkeeper Radoslaw Cierzniak.
It was the hosts who seized the initiative early on, and both Gary Mackay-Steven and Nadir Ciftci passed up opportunities to open the scoring before the visitors asserted themselves.
The key moment came three minutes after half-time, when an innocuous-looking 30-yard shot from May squirmed under Cierzniak and into the home net to groans from the crowd.
Tempers then frayed on the sideline after United substitute Farid El Alagui went down in the box looking for a penalty, and the incident resulted in both Jackie McNamara and Tommy Wright being sent to the stands.
Saints continued to cling on to their slender advantage, surviving another penalty shout from Mackay-Steven in injury time to clinch the points and move into the top six.