Switzerland’s Sebastien Buemi, last year’s winner in the Moroccan city after Rosenqvist had started on pole, finished second for Renault e.dams with Britain’s Sam Bird third for DS Virgin Racing.
Buemi led from pole this time but it was the Swede, starting in third place, who took his third career win in the all-electric series.
“Last year was the point where we learnt what we needed to do to and this year we did it,” said Rosenqvist, who took second from Bird just before the change of cars and then passed Buemi with four laps to go.
Defending champion Lucas di Grassi of Brazil retired from the race with a battery problem.
Rosenqvist has 54 points to Bird’s 50 with Techeetah’s Jean-Eric Vergne third on 43.
The next Formula E race is in the Chilean capital Santiago on Feb. 3.
Reporting by Alan Baldwin, editing by Pritha Sarkar