Benin's Olivier Verdon was sent off near the end for a huge foul on Gueye.
Benin threatened on rare counter-attacks especially from set-pieces and should have scored the opener in the first half through Pote who flicked the ball from a cross in the 18-yard box but went off target.
Senegal had more possession but did not really create clear chances in the first 45 minutes.
The breakthrough came in the 70th minute through Gueye. The Everton midfielder started and finished a move which saw Sadio Mane tee up his team-mate to score.
Few minutes later, VAR, ruled out Mane’s goal as the Liverpool man was deemed to have been in an offside position.
Diagne and Mane carved Benin defence open once again but could not double the lead as Benin goalkeeper and defenders combined to clear the ball.
The Teranga Lions will come up against the winner between Tunisia and Madagascar.