Twenty kicks were needed before the continental champions advanced 9-8 on penalties after losing the second leg of their final round qualifier 1-0 to their hosts in Kampala.
Patrick Ochan missed the key kick in the post-match shootout amid an atmosphere of spiraling tension as Uganda threw away an early advantage and again missed out on qualification by the narrowest of margins.
They had been well placed after losing just 1-0 in Ndola in last month's first leg tie and levelled the aggregate score after 27 minutes on Saturday through Geoffrey Massa.
But a second goal proved elusive for Uganda, coached by Scotsman Bobby Willimason, despite the urgings of the capacity crowd as Zambia goalkeeper Kennedy Mweene produced a series of heroic saves to keep his side in the tie.
The match went to penalties after 90 minutes and immediately Zambia captain Chris Katongo, who had been their catalyst in winning the last Nations Cup, had the first kick saved.
But Uganda quickly ceded the early advantage and, after the penalties went into sudden death, were forced to keep scoring to stay in the contest, a pressure that proved too much for Ochan.
Zambia won this year's Nations Cup with a penalty shootout triumph over the Ivory Coast in the final in Libreville, Gabon.
Uganda narrowly missed out on a place at the last finals when they failed to win at home in their last group qualifier. They last competed at the Nations Cup in 1978, when they were runners-up.
A rampant Mali side beat Botswana 4-1 to ensure their progress. Goals from Cheikh Tidiane Diabate, Modibo Maiga, Mahamadou Samassa and Abdou Traore secured a 7-1 aggregate triumph in their final round qualifying tie in Lobatse. Mali led 1-0 at halftime.
The match marked the re-opening of the reburbished stadium in Lobatse but there was little for the home fans to celebrate until a consolation goal in stoppage time at the end of the match from Mmusa Ohilwe.
Mali finished third at the last Nations Cup finals.
Ghana became the first country to qualify after debutant Afriyie Acquah scored the only goal to secure an away victory over Malawi.
Acquah, brought into the squad as a late replacement, struck after four minutes of the final round, second leg tie in Lilongwe to ensure Ghana's progress.
The 1-0 win followed a 2-0 home triumph in last month's first leg.
Ghana were one of the favourites at the last Nations Cup but were upset in the semi-finals by eventual winners Zambia. They finished fourth in the 2012 finals in Equatorial Guinea and Gabon.
The next Nations Cup is in South Africa from January 19 to February 10.