Chris Humphrey had opened the scoring prior to the break, before Georgios Samaras headed an equaliser for the visitors.

McFadden had come off the bench twice since re-signing for Motherwell, appearing in consecutive defeats against Dundee United and Ross County which had seen Motherwell slump from second to fourth place.

But his first start since playing for Everton against Wolves on May 6 last year saw them return to second spot.

The 10-man Dens outfit looked set for their 20th defeat of the league campaign after losing Declan Gallacher following his last-man tug on the scorer of Saint's opening goal, Steven MacLean.

But former Falkirk man Stewart popped up with a last-minute leveller to keep the basement club 15 points adrift of safety.

MacLean had headed the Perth side ahead 35 minutes in after home goalkeeper Rab Douglas sullied his 300th appearance for Dundee with a handling gaffe, but John Baird cancelled that out with his own header just before the break.

Saints struck again through skipper Dave Mackay's free-kick on 68 minutes as he made sure it was a double punishment for the hosts following Gallacher's dismissal.

However, just as the visitors thought they had done enough for the Tayside derby win, Stewart struck at the death.