A minute earlier Carter missed with a drop goal off his right foot, but struck gold with his left with only seconds remaining in front of 21,000 spectators at AMI Stadium.
Having lost the first test in Auckland a week ago 42-10, the Irish were given no show in Christchurch, a city which hasn't experienced test rugby for almost two years.
But they dug deep, and led by their impressive forward pack, came within a sniff of victory. It would have been their first over the All Blacks in 107 years of trying.
In a sometimes spiteful match, All Blacks fullback Israel Dagg was sinbinned with eight minutes left for a late and high hit on fullback Rob Kearney.
From the resulting penalty, Jonathan Sexton missed a long penalty attempt with eight minutes which would have given the Irish the lead.
Instead it was Carter who was the hero on a difficult night for New Zealand.
It was a much-improved performance from Ireland, the forward pack in particular played with a directness and intensity which troubled the All Blacks at the breakdown and in contact.
Julian Savea, who scored a hat-trick on debut in the comfortable win in Auckland last weekend, hardly saw the ball and struggled under the high ball and the All Blacks' tight five were overshadowed by their opposites.
Make no mistake, the All Blacks were in a serious scrap in this match, literally at times, referee Nigel Owens speaking to Richie McCaw and Brian O'Driscoll at tensions boiled over on the hour mark with the score 16-13.
The men in green were boosted by the return of injury of tighthead prop Mike Ross and loosehead Cian Healy also played well. A retreating All Blacks scrum late in the match was testament to that.
The All Blacks threatened to break free but couldn't quite shake the Irish. Regular penalties from Sexton kept them in it and frequent injury stops added to the disjointed nature of the game.
A sign of All Blacks anxieties was the sight of Carter attempting a drop goal after 58 minutes. They missed Kieran Read in the second half, the No8 appearing to injure himself in one of his many carries, was substituted at halftime for Sam Cane.
The All Blacks took the lead when Aaron Smith scored two minutes after the break when he was pushed over in a pile of bodies. It came after a strong Sonny Bill Williams' run. Carter converted from near the sideline.
Sexton brought the Irish back to 16-13 with his second penalty.
Ireland began strongly, in cold but still and dry conditions, maintaining possession and testing the All Blacks with rolling mauls.
Ill discipline from the home team was costly, with both props Tony Woodcock and Owen Franks penallised for leaving their feet at ruck time.
The first penalty put the Irish deep into All Blacks territory and the second led to their first try after 10 minutes to halfback Conor Murray. A rolling maul put the All Blacks' forwards on the back foot, with Murray taking full advantage and slipping over from close to the line for a seven-pointer.
A Sexton penalty after 19 minutes put Ireland further ahead.
The All Blacks replied with renewed enthusiasm, Carter making a half break and Conrad Smith carrying strongly. Carter's penalty narrowed the gap.
The All Blacks threatened but passes refused to stick. Dagg made a break but his pass to Savea was wayward. Many of the All Blacks' errors came from Irish pressure. Their endeavours at the breakdown and in contact were a step up from the first test.
Another two Carter penalties for ruck offences brought the All Blacks closer.
Carter had the chance to kick the All Blacks into the lead after the halftime hooter but his attempt from about 55m was just short. Moments earlier he had missed touch with a penalty which would have put his side hot on attack.
No matter, he would be the hero in the dying seconds. The All Blacks clinched the series, but in the toughest of ways.
All Blacks 22 (Aaron Smith try; Dan Carter con, 4 pens, drop goal) Ireland 19 (Conor Murray ; Jonathan Sexton con, 4 pens)
HT: Ireland 10-9