Sri Lanka were 231 for six at stumps, 429 runs short of their improbable 660-run target, with doubt whether the injured Angelo Mathews would return.
At the crease were Dilruwan Perera on 22 and Suranga Lakmal on 16.
Wagner, who had enjoyed little success in the series, broke through stubborn Sri Lankan resistance to have figures of three for 47.
After rain ensured a drawn first Test in Wellington, a win in the Christchurch decider would give New Zealand a fourth consecutive series win for the first time after beating the West Indies, England and Pakistan earlier this year.
Despite losing both openers in the first two overs of their second innings, Sri Lanka fought to stay in the game until short-ball specialist Wagner came into the frame.
Skipper Dinesh Chandimal and Kusal Mendis produced stubborn resistance for 53 overs for the third wicket before Mendis went for 67.
They had seen off the swing and seam of New Zealand strike bowlers Tim Southee and Trent Boult at the start of the day, were untroubled by spinner Ajaz Patel, and initially, they dodged the barrage aimed at the ribs by Wagner.
Wagner's first success came when he changed tack and lured Mendis into a false sense of security.
Mendis, who in the course of his innings became only the second player behind India's Virat Kohli to score 1,000 runs this year, was frustrated as Wagner forced him on to the back foot with successive deliveries.
When the next ball was full length, the 23-year-old could not resist going for the drive and was smartly caught by substitute fielder Matt Henry diving to his left at extra cover.
Angelo Mathews, who in the first three innings of the series scored 236 runs and was dismissed only once, reached 22 when he was forced to retire at tea with a hamstring injury.
He pulled up lame running between the wickets about 10 minutes before the interval and could only hobble after that.
Chandimal faced 228 deliveries before he fell victim to a Wagner bouncer that zipped from the glovers to the helmet and into the hands of the close-in fielder Henry Nicholls.
Niroshan Dickwella batted freely for 19 until the new ball was taken and he chopped a wide Southee delivery on to his stumps.
Silva and Dilruwan Perera took Sri Lanka past the 200-mark before Wagner struck again with Silva caught behind for 18.
Wagner also clouted Perera on the helmet with a rising delivery just before stumps but the batsman was able to play on after being checked by medical staff.
Ajaz PatelAngelo MathewsDilruwan PereraDinesh ChandimalHenry Nichollskusal mendisNeil WagnerNew Zealand vs Sri Lankaniroshan dickwellaTim SoutheeTrent Boult
First Published: December 29, 2018, 11:28 AM IST