Although both teams have already qualified for the Afcon finals, that could not steal the thrill with Salah’s stoppage time strike providing a dramatic finish to the contest as Egypt got revenge after losing the reverse fixture 1-0 last year.
Tunisia had taken the lead 13 minutes into the match through two-goal hero Naim Sliti who beat Egypt goalkeeper Mohamed El Shennawy on a one-one situation after beating an offside trap.
But Mahmoud “Trezeguet” Hassan restored parity for Egypt in the 32nd minute with his strike taking a deflection enroute into the net.
The Pharaohs surged ahead on the hour mark courtesy of a Baher El Mohamady headed goal off an Amr Warda cross, but Tunisia clawed back with Sliti completing his brace after profiting from a poor clearance by Ahmed Hegazy on 72 minutes.
As the match seemed to be headed for a stalemate, Salah then had some quick exchanges with his namesake Salah Mohsen, before beating Tunisia goalkeeper Farouk Ben Mustapha for Egypt's winner.
It was the Liverpool forward’s 10th goal for the Pharaohs in their last eight matches.
The result saw Egypt dislodge Tunisia to settle on top of Group J with 12 points, the same as their North African rivals who slid down to second spot with an inferior goal difference.
Ziyech struck from the penalty spot first before doubling Morocco’s advantage later on, as Morocco leapfrogged Cameroon to open a two-point Group B lead.
The Indomitable Lions ended the match one man short after captain Karl Toko Ekambi was red-carded late in the match.
The defeat was Cameroon’s first in this campaign after they beat Morocco in the reverse leg last year.
It was also Clarence Seedorf’s first defeat while in charge of Cameroon, with his other results being two draws and a win.
In the early stages of the match on Friday, it seemed Cameroon were poised for a win after Eric Choupo-Moting narrowly missed the target on six minutes while under the challenge of Morocco defensive midfielder Karim El Ahmadi.
Ziyech had a long-range shot struck from outside the box go slightly off target on the half-hour mark.
Two minutes after the restart Ekambi had a similarly taken shot from the edge of the box going wide by inches.
Then Morocco’s opener came after Christian Boassogog was adjudged to have pushed substitute Sofiane Boufal inside the box and Ziyech stepped up to convert from the penalty spot in the 53rd minute.
Ziyech completed his double on 65 minutes with a screamer from outside the box after a poor clearance by Cameroon.
If Malawi at least draw with Comoros in another Group B encounter on Saturday, Morocco will qualify for Afcon.
Earlier in the day, former Mamelodi Sundowns forward Fiston Abdul Razak struck a hat-trick as Burundi edged closer to a maiden Afcon qualification with a 5-2 win over South Sudan in Juba.
Cedric Amissi and Hussein Shabani grabbed the other goals for Burundi who need to beat Gabon in their last Group C match next March to book their first ever Afcon tournament ticket.
It was a nightmarish afternoon for South Sudan who have lost all their five matches in this campaign, scoring just two goals and conceding a staggering 15.