Levitt was industrious throughout the afternoon and his long-range strike hauled his side level in the second half, after Jay Henderson had opened the scoring for the home team within just three minutes.
When St Mirren goalkeeper Jak Alnwick was sent for a dangerous challenge late on, it set up a tense finale, and, in the 96th minute, Marc McNulty fired home to earn the three points for the away side.
Wales international Levitt was awarded Man of the Match for his performance, as United leapfrogged Hibernian and Livingston into the top four.