The result leaves Northampton unable to escape the drop despite a spirited performance.
Northampton had early chances, with Sam Hoskins denied by Josh Keeley before Tom Eaves also tested the goalkeeper.
Hoskins eventually gave them the lead on 31 minutes, finishing coolly after being played through. Luton responded just before half-time through Liam Walsh’s long-range effort.
After the break, both sides pushed for a winner, with chances falling to Cameron McGeehan, Jordan Clark and Ali Al-Hamadi, who hit the post.
However, Naismith sealed the result with a superb 30-yard free-kick five minutes from time, securing victory for Luton and confirming Northampton’s relegation.
