The Spireites had trailed to an own goal by Drew Talbot until Jack Lester levelled, before Niven ended 139 years of football at Saltergate with a low drive although it was not enough to earn the home side a play-off place.
Chesterfield had to win and hope other results went their way and started well with both Lester and Mark Allott forcing good saves from Shwan Jalal.
Tommy Lee did well to smother an Anton Robinson shot after he spilled a cross, but Bournemouth went in the 42nd minute when Talbot turned an inswinging corner from Warren Cummings into his own net.
Lester was foiled by Jalal once more after 50 minutes and the home side had strong claims for a penalty rejected a minute later when Lee Bradbury appeared to drag down Rob Page.
Lester finally levelled ten minutes from time when he lashed in a right-foot shot before Niven won the game in dramatic fashion to spark a pitch invasion.