Sevilla striker Youssef En-Nesyri canceled Sierra Leone's early lead by equalizing for the Atlas Lions in the 30th minute.
Five minutes later, winger Sofiane Boufal doubled the lead for Morocco.
En-Nesyri continued his dazzling performance, netting the second ten minutes into the second half.
Morocco, drawn in Group F alongside DR Congo, Zambia and Tanzania, will start their Nations Cup campaign on Wednesday 17 January against Tanzania.
With a single title in 1976 and a finalist appearance in 2004, the Moroccan national team hope to end their 48-year African trophy drought and win the title.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)