After Serge Gakpe's opener for Togo was cancelled out by Khalid Mouelhi's penalty, the two countries finished level on points, with Togo owing their first appearance in the knockout phase at the seventh attempt to superior goal difference. Mouelhi then missed from the spot late in the second half, his failure condemning Tunisia to an early exit.
The draw bagged Togo the runners-up spot in Group D and a last eight match-up with Burkina Faso here on Sunday, with the Burkinabe coach Paul Put an interested observer in the stands.
Togo coach Didier Six made two changes, Moustapha Salifou and Jonathan Ayite dropping to the bench and replaced by Vincent Bossou and Ayite's brother, Floyd.
Skilful midfielder Youssef Msakni started for Tunisia after overcoming a bout of tonsilitis. Coach Sabr Trabelsi brought in Oussama Darragi, Walid Hichri and Wahbi Khazri for Fakhreddine Ben Youssef, Bilel Ifa and Anis Boussaidi. Tunisia were once again without injured key striker Issam Jemaa.
On ten minutes Togo captain and Tottenham Hotspur striker Emmanuel Adebayor almost put the little west African nation in front. Three minutes later Togo did take the lead, with Adebayor neatly finding Gakpe, the Nantes striker slotting the ball past Moez Ben Cherifia.
Tunisia, requiring two goals now to deny Togo, were struggling to make their presence felt at the Mbombela stadium - until the 28th minute, when they drew back level via Mouelhi's side-footed penalty awarded when Dare Nibombe fouled Esperance midfielder Hichri.
Tunisia, buoyed by their equaliser, ended the first half the better side, and they had a justified but rejected appeal for a second penalty after the restart when Vincent Bossou felled Darragi.
Down at the other end, Adebayor skipped past a couple of Tunisian defenders, squaring the ball into the box but Komlan Amewou was unable to do the move justice.
On 69 minutes Adebayor's flying header hit the crossbar as Togo came at the Tunisians with all guns blazing again.
South African referee Daniel Bennett pointed to the spot in the 76th minute, after Saber Khalifa tumbled to the floor after light contact by Nibombe. But Togo won a reprieve when Mouelhi's poor spot-kick hit Kossi Agassa's left post, and they deservedly held on to set up a date with Burkina Faso.