Yaya Toure scored twice to help give the Elephants a five-point lead over Morocco with only one game left to play.
They were on the back foot early on as Amri Kiemba scored for Tanzania just seconds into the match, but Lacina Traore levelled after 13 minutes before Toure put Ivory Coast in front.
Thomas Ulimengu equalised for the hosts in the 35th minute but Toure's second moments before the break gave the visitors the lead at half-time.
That one-goal lead stood throughout the second half with Wilfried Bony sealing it in injury time with the fourth.
Soon after, Ethiopia joined Ivory Coast in reaching the play-offs with victory over South Africa in the battle of Group A's leading pair.
They too had to come from behind after Bernard Parker put South Africa ahead in the 34th minute.
Getaneh Kebede levelled shortly before half-time and an own goal from Parker 20 minutes from time settled it in Ethiopia's favour as they moved five points clear.
Egypt are also through from Group G following a 1-0 win over Mozambique which came courtesy of Mohamed Salah's goal five minutes before half-time.
Ghana edged into top spot in Group D with a 2-0 victory over Lesotho.
Christian Atsu opened the scoring in the final minute of the first half, and Asamoah Gyan made sure in the 75th minute.
The win puts them one point clear of Zambia with one game left to play.
Mali's hopes of pipping Algeria to top spot in Group H ended today as while their rivals beat Rwanda, they were held to a surprise 2-2 home draw by Benin.
Mali twice fought back from a goal down, goals from Mahamadou Samassa (15, pen) and Cheick Diabate (69) cancelling efforts from Benin duo Stephane Sessegnon (eight minutes) and Razak Omotoyossi (32), but they could not go on to force a winner as they fell four points behind Algeria.
In Group J, Senegal returned to top spot as a brace from Papiss Cisse earned them a 2-0 win at Liberia.
The Newcastle striker opened the scoring from the penalty spot in the 19th minute and then doubled his account nine minutes into the second half as Senegal moved a point above Uganda, who beat beat Angola yesterday.
Also today, Group B winners Tunisia were held to 1-1 draw away to Equatorial Guinea, the hosts taking a 30th-minute lead through Juvenal's penalty only for visiting playmaker Oussama Darragi to level things up with another spot-kick in the 64th minute.
In Group G, Guinea beat Zimbabwe to move on to 10 points but they cannot catch first-placed Egypt.