A goal by the former Napoli defender allows the Africans to snatch second place.
The Tricolor need only a draw to advance to the round of 16, while the Lions of the Teranga are obliged to win to clinch qualification.
The challenge between the Oranje and the South Americans ended in a draw.
The two national teams compete for the top spot in Group A.
The hosts had to surrender to the Tricolor who won 2-0.
The 33-year-old Fenerbahce forward scored on a penalty kick to give Ecuador the lead in its debut match against Qatar. Shortly before, he had had a goal disallowed on action by Var.
Overlap between the first match of the World Cup and the final of the singles tournament avoided.