Mashahid website said the man "filed a complaint against a night watchman who had hit his car, but the court took no action, pushing him to take the action" in the city of Agadir.
Suffering second degree burns, the unnamed man was taken to hospital under police escort, said another Moroccan news website, Lakome 2.
It said he was to be questioned to determine if he should face legal action.
His action mirrored that of young Tunisian fruit seller Mohamed Bouazizi who set himself alight in December 2010 and died a month later, sparking a revolution in his country and the 2011 Arab Spring.
In 2013, a door-to-door salesman in Marrakesh, in the centre of Morocco, a county where the World Bank says one in three young Moroccans are jobless, died after setting himself on fire to protest the confiscation of his merchandise.