Lincoln City 2 Wrexham 4
The Welsh club, who were playing in Europe just 12 seasons ago, were already doomed to finish bottom of the League even before the kick-off.
But they came out fighting and gave their fans a glimmer of hope for next season.
The Robins went in front after 11 minutes when a free kick from Wes Baynes was headed in by Levi Mackin.
Lincoln struggled against the lively opponents and suffered a blow in the 28th minute when influential central midfield man, Lee Frecklington, was forced off with a shoulder injury.
Frecklington was later taken to hospital and, within five minutes, Lincoln had conceded a second goal.
Lincoln's Gary Croft handled on the edge of the box to keep out Baynes. Then from the resulting free-kick, Baines drilled his shot past the wall and into the bottom corner.
Lincoln pulled a goal back out of the blue in the 39th minute.
Centre-back Lee Beavers punted a 50-yard clearance into the Wrexham box, where visting centre-back Steve Evans was under no pressure but sent his header over advancing keeper Gavin Ward, who could only watch in horror as the ball rolled into the net.
Lincoln improved after the break and they went close when a long-range effort from Paul Green was saved by Ward.
The Wrexham keeper then did well to keep out a free kick from Jamie Forrester but was saved on the hour when Carl Tremarco cleared off the line to prevent Ben Wright from scoring.
Wrexham restored their two-goal lead when Baynes hit another long-range free kick, past the wall and into the net.
The entertainment continued in stoppage time, Wright scoring his 15th goal of the season with a left foot shot.
Lincoln pushed forward for the equaliser and Beevers was denied by the post before Forrester missed the easiest of chances.
Wrexham then broke away in the third minute of time added on with Chris Llewellyn forcing his way through before beating Duffy.