Substitute Alireza Jahanbakhsh was NEC Nijmegen's hero as his two goals staved off automatic relegation from the Eredivisie, condemning Roda JC to the drop instead.
Roda's 1-0 win at Go Ahead Eagles, which came courtesy of Davy de Beule's 16th-minute goal, meant NEC needed at least a point away to champions Ajax to save themselves.
Jeffrey Leiwakabessy's early own goal put them in trouble and it was not until the introduction of Jahanbakhsh on the hour that NEC battled back.
The Iran winger equalised in the 74th minute and repeated the feat two minutes from time, after Bojan Krkic had restored Ajax's lead.
NEC will still face a relegation play-off and will face Sparta Rotterdam from the second tier. They will be joined by RKC Waalwijk, who will tackle De Graafschap after predictably finishing 16th.
RKC needed a win, an NAC Breda defeat and an eight-goal swing in their favour to move out of the bottom three.
And though PSV Eindhoven obliged by beating NAC 2-0 - Memphis Depay and Jeffrey Bruma with the goals - RKC were hammered 3-0 at home by Heerenveen.
Joey van den Berg opened the scoring five minutes before half-time and Bilal Basacikoglu doubled the lead before Alfred Finnbogason's penalty set the seal on the result.
Feyenoord's Champions League place was already secured and they rounded off their campaign with a 1-1 draw away to AZ Alkmaar, Lex Immers' goal cancelled out late on by AZ substitute Johann Berg Gudmundsson.
Third-placed FC Twente also drew, 2-2 at home to PEC Zwolle. A flurry of first-half goals saw Twente's Kyle Ebecilio and Dusan Tadic score either side of Athanasios Karagounis' reply, but Furdjel Narsingh drew Zwolle level again in the 71st minute.
Twente will enter next season's Europa League at the play-off round, with fourth-placed PSV in the third qualifying round.
Heerenveen had to settle for fifth and a place in the European play-offs alongside Vitesse Arnhem, who finished sixth despite a 2-1 defeat to FC Utrecht, FC Groningen, who beat Heracles Almelo 3-1, and AZ.
ADO Den Haag won 2-1 away to Cambuur Leeuwarden in the day's other game.