Dalkeith Thistle’s failed to capitalise on their second half lead to allow St Andrews to draw the match.
Thistle might have scored in only the second minute when Chris Cairns headed a clear chance off the target.
But at the other end in just eight minutes, United opened the scoring when a neat through ball was latched onto by Scott Lawrie who steered the ball past home keeper Jim McQueen.
Next Daryl Falconer saw a chance well defended by Ryan McQueenie as United called the shots before a rare Thistle raid saw Daryl Devlin hit wide of the Saints target.
In 18 minutes an excellent save by Saints’ keeper Sean Hunter denied Cairns the Thistle equaliser.
In 33 minutes Ryan McQueenie headed from a corner but too high then quickly at the other end Scott Lawrie rattled a shot into the Dalkeith side net.
Gradually Thistle were having more possession without scoring until the 43rd minute when along came the equaliser following a foul by Stuart McDonald on Cairns and from Blake Wales’ resultant free kick it was Ryan McQueen who headed home a fine goal to level the scoring at half time.
On 52 minutes, Thistle’s Daryl Devlin was felled just on the 18 yard line but the resultant free kick from Kenny McMillan was well parried by keeper Hunter.
Three minutes later at the other end a Lawrie shot whizzed across the face of the home goal.
It continued to be a tight end-to-end fight with the next goal crucial and it was Dalkeith who went 2-1 up in 70 minutes via a penalty kick when a shot from Wales was handled by McDonald and the referee pointed to the spot with Ryan McQueenie making no mistake sending keeper Hunter the wrong way.
However the 2-1 lead lasted less than one minute as in their very first reply, Dalkeith were caught napping to allow Saints to equalise as a ball not cleared fell to Ross Cunningham who promptly dispatched the ball to the back of the Dalkeith net.
Next in 78 minutes Dillon Honeyman went close with a shot for the Saints in a nail-biting last few minutes which saw a McMillan header too high for Thistle and an excellent save by Hunter denying Thistle a winner with United’s Scott Lawrie going closest smashing a fierce shot that came back off the Thistle crossbar just two minutes from time.
Thistle: McQueen, Robertson, Murray, McQueenie, Hall, McGlashan, Cairns, Devlin, McMillan, Leslie, Wales. Subs: McNeill, Muir, Trialist, Connel, Bain.