The Minsterman, relegated in 2004, were beaten finalists two years ago, but went one better on Sunday afternoon as goals from Ashley Chambers and Matty Blair wiped out Andre Gray's early goal.
Luton were ahead after just 71 seconds thanks to Gray, but York took control and Chambers drew level in the 26th minute. And they took just 69 seconds of the second half to take the lead - though the goal that turned out to be the winner should have been ruled out for offside.
Larne Oyebanjo launched a long throw into the area, Jason Walker flicked on and Blair advanced a yard past the last defender and tucked home.
Luton were unable to respond in the manner that the Minstermen did after going behind so early in the first half, and James Meredith headed over and Chambers brought a save out of Mark Tyler as the Minstermen pushed.
The Hatters eventually stirred and Gray should have levelled, but just three yards out he inexplicably missed his kick twice and York cleared their lines, while some heroic defending from Oyebanjo denied John Kissock.
Luton threw everything forward in the final minutes in a bid to force extra time, but York held firm to seal their return to the Football League.