We put this question to Shaykh Muhammad ibn Saalih al-‘Uthaymeen, may Allaah preserve him, who answered as follows:
I think that he should stay, and there has to be someone else with him. If there is no one with him, he should go to another mosque and pray there with the jamaa’ah. With regard to his salary, he has to tell the responsible authorities and if they let him stay, that is OK.
And Allaah knows best.