Calum Butcher’s goal (43) put the visitors on course to cut Celtic’s lead at the top to two points, but their failure to kill off the game allowed Saints to fight back through Michael O’Halloran (76) and Chris Millar (86).
Millar’s late winner means Saints go into 2015 on the back of eight undefeated games and within five points of Jackie McNamara’s side, who drop a place to third.
Celtic’s failure to beat Ross County at Parkhead meant an opportunity for United, and they were ahead when Butcher slid in to hit Stuart Armstrong’s first-time pass back across Alan Mannus at the end of a drab first half.
Several chances for a second went begging after the break, Armstrong missing two on his own and Nadir Ciftci ignoring well-placed team-mates to fire wide.
Saints’ sole threat had been Dave McKay, who tested Radoslaw Cierzniak at the start of the second half, but the pattern of play changed completely when O’Halloran headed in Lee Croft’s centre.
And Millar secured the win, making space for a shot 15 yards out and firing through a thicket of legs and beyond unsighted Cierzniak.