It was no great surprise when Makgopa slotted home the opener just after the break, following a first half in which Morocco failed to register a shot on target in a tense battle in San Pedro.
The Atlas Lions missed a chance to draw level from the penalty spot in the 85th minute, when Achraf Hakimi hit the bar.
The North Africans then had Sofyan Amrabat sent off in the dying stages of the match for a professional foul, which handed Mokoena the chance to score one of the goals of the tournament so far from the resulting free-kick just outside the area.
Added to that, Morocco coach Walid Regragui had declared the need to win Afcon for only the second time in the nation’s history to confirm they were the best team on the continent following their semi-final appearance in Qatar.
“It is not the end of the world. We are not the only ones,” said Regragui, whose country will host the next Nations Cup finals.
“Lots of the favourites have been eliminated. We will come back stronger.”
The three most successful teams in the history of the competition, Egypt, Cameroon and Ghana, with 16 titles between them, had all departed before South Africa’s surprise victory.
Along with the exit of Senegal on penalties on Monday, all five of Africa’s 2022 World Cup qualifiers have been knocked out of the tournament.
It has been the year of the underdog at this Afcon and the growth of the game on the continent is there to see through the nations that are achieving success – along with the number of African-based players balancing out the usual swath of European-based stars.
“Local players can be good also when they are ready to play a level higher,” said Broos, whose squad is overwhelmingly made up of players from South Africa’s domestic league.
“This is what’s happened with South Africa.
“We are not playing anymore like South Africans. The style is different now. We play a little bit more, or try to play a little bit more, like Europeans. And that helps us a lot.”