Those who are overstayed in Japan may be deported under the Immigration Law.
However, the Minister of Justice may grant the special permission to stay in Japan if:
1.they have obtained the permission for permanent residence;
2.they had been domiciled in Japan as Japanese nationals;
3.the Minister of Justice finds grounds for granting the special permission to stay; or
4.they have been recognized as refugees
No.3 is the most considerable. The cases where an overstaying foreigner is married to a Japanese and wishes to live in Japan for a very long time is applicable.
But you have to be careful that the decision will made by a close examination.