The Atlas Lionesses' winning goal was scored by Anissa Lahmari (45th+1), moving Morocco to the second place in Group H behind Colombia (6 points each).
In the group's other game, Germany drew 1-1 with South Korea and took the 3rd place, 1 point ahead of fourth-placed South Korea.
Morocco, the first Arab team to reach the finals of the Women's World Cup, were beaten by Germany on the first matchday before beating the South Koreans on the second.