Golden Boot winner Aymen Mahious had a chance to win a competition reserved for footballers playing in their country of birth when he stepped forward to take the 10th spot-kick.
But his attempt was weak and straight at goalkeeper Pape Sy, who saved comfortably, leaving the teams deadlocked at 4-4, and necessitating a sudden-death extension to the shootout.
Ousmane Diouf calmly converted to edge Senegal ahead amid whistling from many in a sell-out 39,120 crowd at the Stade Nelson Mandela in Algiers. Ahmed Kendouci had to score to keep Algerian hopes of victory alive, but his shot rebounded off the crossbar and Senegal were champions.
The local-based team triumphed a year after the full Senegal team, including stars like Sadio Mane, beat Egypt on penalties to win the premier competition, the Africa Cup of Nations.