York travelled to Field Mill to take on
The second-leg was goalless after 90 minutes but a Matty Blair header nine minutes from the end of extra-time sent York to Wembley.
To make matters worse for Mansfield they had Ritchie Sutton sent-off just before the end for a second bookable offence.
Luton lost 2-1 at
The Hatters took complete control of the tie when George Pilkington struck home a 25th minute penalty to put them 3-0 up on aggregate.
Adrian Cieslewicz bundled one back for Wrexham in the 63rd minute and then it was game on again in the 77th minute when Andy Morrell put home his own rebound after his initial effort hit the post.
Luton also had to survive eight stoppage-time minutes before the referee finally blew his final whistle.
The play-off final takes place at Wembley on May 20th.