Morroco itself being an Arabo-Islamic concept to begin with (issued from the conquest of the western North Africa), it's going to be tricky to have such a state being considered as European.
The best bet would be having a Morroco-Algravi or Morroco-Grenadi state managing to get the lead in Maghrib, Sudan and Ifryqia, sort of competer of Ottoman power (if it exists, of course).
It's not the most plausible situation ever, but you may end with a Turkey-like situation : if it holds a bit of Europe, it could be considered as European. Somehow. Maybe.
In a pre-1900 PoD, I'm not sure you have real good choices.
A post-1900 PoD *may* be more interesting.
Morroco issued a candidacy for the EEC in 1987, but it was rejected on the grounds the country wasn't in Europe.
*Maybe* with a Cold War far more tensed, with Algeria (and possibly other Western African) countries being definitely pro-Soviet, acceptance of the candidacy may lean to consider Morroco as part, somehow, of Western Europe.