The match could not have started better for the Russian club, with Sergei Covalciuc heading home from a corner in the 2nd minute. The rest of the first-half was scrappy and there were few clear-cut chances for either side.
The second-half continued much in the same fashion until the final six minutes saw a dramatic turnabout in fortunes. First NEC's Jhon van Beukering headed past Stipe Pletikosa in the Spartak goal in the 84th minute, and then Lasse Schone was given all the time he needed to shoot and score in the 87th.
The win was NEC's first in the group stages, and Spartak's second consecutive home defeat in Group D.
A win would have seen Spartak guaranteed a place in the Round of 32. The Muscovites now need to better NEC's result in their home match against Italian side Udinese in their game against Tottenham in London. Both games kick off simultaneously on December 18.
Tottenham's on-form striker Russian Roman Pavlyuchenko, who signed for the club from Spartak in the summer, will be unable to face his former teammates as he is cup-tied, having played for the Muscovites in the Champions League qualifying rounds.
If Spartak do make it through they will join CSKA Moscow, who have already secured a place in the next round, and Zenit St. Petersburg, who will drop down from the Champions League after taking third place in their group behind Juventus and Real Madrid, in the draw for the last 32.
Although revitalized Brazilian star Ronaldhino's AC Milan are favorites to lift the UEFA Cup, Russian sides have established a good record recently in the tournament, with CSKA Moscow winning the trophy in 2005 and Zenit the current holders.
CSKA are the only side with a 100% record in the group stages after three matches and travel to French club Nancy on Thursday for the final game of the season. The club's manager, Valery Gazzayev, is widely expected to announce before the game that he will remain at the club. Gazzayev, the only Russian trainer to win a major European club trophy, had earlier declared that he would quit at the end of the year.