The All Blacks' 40-17 triumph consigned Wales to a fourth place finish for the second time in three World Cup campaigns under Gatland.
It also extended New Zealand's winning run against Wales to 31 Tests, having not lost in the fixture since 1953.
Gatland's 12-year reign, highlighted by four Six Nations titles, three Grand Slams and two World Cup semi-final appearances, could not find a fairytale finish.
New Zealand had the game sewn up by half-time through wing Ben Smith's try double, plus touchdowns for prop Joe Moody and full-back Beauden Barrett, with fly-half Richie Mo'unga kicking four conversions.
Wales countered through Hallam Amos' clever try and five points from Rhys Patchell, but centre Ryan Crotty's try and another Mo'unga conversion early in the second-half finished them off before Mo'unga added a late touchdown.
Dan Biggar converted, leaving an under-strength Wales to take considerable comfort from a battling display that augers well for their future under Gatland's successor Wayne Pivac.
Gatland made nine changes for his final game in charge, with injuries sidelining players like Leigh Halfpenny, George North and Aaron Wainwright, while wing Owen Lane made a World Cup debut and lock Adam Beard also started.
The Wales players did not follow England's example in the semi-final last weekend of encroaching over the halfway line while New Zealand performed their pre-match Haka.
They faced it in regulation fashion standing on their own 10-metre line, but Wales were soon back-pedalling under pressure before Mo'unga hit the post with a straightforward penalty chance.
But the All Blacks struck after five minutes following a charge by lock Brodie Retallick that ended with Moody touching down and Mo'unga converting for a 7-0 lead.
Wales showed some promising glimpses, with wing Adams prominent in attack, but New Zealand cut them open again in the 12th minute when scrum-half Aaron Smith broke sharply and found try-scorer Barrett.
Mo'unga again converted, and Wales were already hugely up against it, trailing by 14 points.
Wales then sacrificed two kickable penalties, and their forwards went close to breaching New Zealand's defence before Amos applied a neat finish, claiming a try that Patchell converted.
Wales continued to attack with freedom, and Patchell kicked a 27th-minute penalty that made it 14-10.
Wales' response to two early setbacks had been outstanding, and another pinpoint Patchell touch-finder took them back inside New Zealand's 22.
Both sides looked to attack at every opportunity, and New Zealand struck next when Smith worked his way over for a try, again converted by Mo'unga.
Wales continued to have plenty of possession, yet New Zealand finished the half well on top.
Smith sprinted over for a second try in five minutes, and another Mo'unga conversion made it 28-10 at the interval.
New Zealand had gone up a gear, and their fifth try arrived just two minutes into the second period, with Crotty crashing over and Mo'unga converting.
It looked like being a long second-half for Wales, and Gatland began making changes, with half-backs Biggar and Gareth Davies both going on.
New Zealand had the game done and dusted, though, to at least gain something tangible from a World Cup campaign that saw England end their hopes of a world title hat-trick.