The victory followed a 1-1 draw in Ghana last week Friday.
The first half ended with both sides failing to find the back of the net.
After the break Yaw Yeboah, the skipper of the side who missed from the spot kick in Accra, scored the all-important goal in the 70th minute.
In the latter part of the game Algeria threw everything into attack and mounted pressure on Ghana.
But the defence managed to clear their lines very well and also the good goalkeeping displayed by Kwame contributed to rescue Ghana from conceding, despite five minutes of additional time.
The Black Meteors have therefore qualified 2-1 on aggregate for the 2019 Africa U-23 Nations Cup, which is also the qualifiers for the 2020 Summer Olympic Games
The 2019 Africa U23 Nations Cup will be staged in Egypt in November.
Black Meteors starting XI against Algeria in Setif:
1. Kwame Baah (GK)
2. Gideon Mensah
3. Kingsley Fobi
4. Habib Mohammed
5. Nicholas Opoku
6. Michael Agberkornu
7. Isaac Twum
8. Yaw Yeboah
9. Bernard Tekpertey
10. Joseph Paintil
11. Dauda Mohammed