Saad Knia put the North Africans in the lead on four minutes before Angola captain Paulo Alberto Ribeiro levelled just before the break.
Four minutes from recess, Morocco were back in the lead through their captain Adil Habil only for Quissanga Alberto de Almeida to level a minute later.
An own-goal by Artur Saddam da Silva restored the Moroccans lead before El Mesrar scored on 37 minutes and three minutes later to seal victory.
Angola next face Egypt on Monday, 18 April 2016 whilst Morocco will be up against Libya, both at Ellis Park.
Group B Results
Egypt 0-0 Libya
Angola 2-5 Morocco