Overstay in morocco

Hi I would like to apply for my carte sejour, I have a work visa and all the documents ready . The problem is I overstayed by about three months. Do I have to go through the process of getting the authorization to leave and  then apply or can I just apply and say I couldn't leave due to my job in Morocco?