Pierre De Wit gave the visitors the lead after just seven minutes only for Hannover to equalise seven minutes before the break thanks to an own goal from Alexander Bugera.
Didier Ya Konan grabbed the winner with 19 minutes to go.
Hannover ended the season undefeated at home and in seventh place while Kaiserslautern propped up the rest, already preparing for life in the second division.
The hosts had a big chance after just two minutes but Lars Stindl headed wide right from eight yards.
And it was Lautern who jumped ahead five minutes later as a loose ball went to De Wit, who hammered a wonderful effort into the top corner from 25 yards.
Hannover poured forward in search of an equaliser but found their luck out.
Jan Schlaudraff's shot hit the right post after 17 minutes while Lautern keeper Tobias Sippel made a superb save from Mohammed Abdellaoue eight minutes later.
Lautern defender Florian Dick cleared Stindl's attempt off the line in the 27th minute, and Ya Konan's piledriver went inches wide three minutes later.
The hosts finally got the equaliser after 38 minutes as Ya Konan's header was saved by Sippel but the rebound went off Bugera and into his own goal.
Hannover continued their push for the three points and grabbed the lead after 71 minutes with Stindl's free-kick from the left side finding Ya Konan and he nodded in from six yards out.
Hannover almost added a third but Artur Sobiech's header hit the crossbar after 85 minutes.