Afsha converted the spot-kick on 71 minutes after left-back Ahmed Fattouh was felled by Lebanon’s George Melki.
Egypt lie second in the group with three points, behind Algeria on goal difference after the fellow North Africans crushed Sudan 4-0 earlier in the day.
The Pharaohs, playing with a team mainly comprising home-based players, struggled to break down Lebanon’s massed ranks, with coach Carlos Queiroz’s selections drawing some criticism.
The Portuguese once again fielded natural forward Mohamed Sherif as a left-winger, with the Ahly man failing to make an impact. Other players who excelled in the early stages of the Egyptian Premier League, such as Smouha’s on-loan striker Marwan Hamdi, were also peripheral.
Sherif had Egypt’s best chance in the first half, heading wide when well-positioned to score following a flick from the lively Afsha three minutes before the break.
Substitute Ahmed Refaat also wasted a clear-cut chance when he was released by a defense-splitting pass from Ahly midfielder Amr El-Sulaya on 52 minutes, only to fire straight at keeper Mostafa Matar, who pulled off some fine saves to thwart Egypt on several occasions.
The breakthrough finally came when Fattouh cut inside Melki, who tripped him. Afsha’s powerful effort struck the fingertips of Matar and went in.
Egypt face Sudan in their second Group D match on Saturday.