Andreatta had hinted at a bit of experimentation and the visitors took time to settle after the Australian switched to an unfamiliar back three.
Half chances were traded, with Weir and opposing midfielder Nakkach both firing well over early on before home full-back Nouhaila Benzina had a header deflect just wide.
However, Scotland capitalised on a crazy couple of minutes from Er-Rmichi just before the break.
The visitors were handed a corner after the goalkeeper was penalised by whistle-happy referee Natacha Konan for taking too long to release the ball.
From Cuthbert’s first corner, Er-Rmichi slapped at full-back Nicola Docherty cross.
And, from the resulting second, the goalkeeper waved at thin air as she tried to reach over a clutch of heads at the front post while the midfielder’s wicked inswinger whizzed over her head into the net.
However, the hosts were the more lively side after the break and, when Nicola Docherty made a mess of a clearance after Jenna Clark headed Jade Nassi’s looping header off the line, Nakkach pounced to fire low into the far corner.
It looked like Scotland and their new head coach would be denied a long-awaited win – until that moment of magic from the visitors’ Ballon d’Or nominee.
