You have to sort this out with your home country first, so the first thing to do is talk to your embassy. Once you have it sorted out with your home country, and have all the necessary documents, you can begin the process of changing your name on your documents in Japan.
This is my assumption anyway. I've never done it myself. But I'm sure Japan doesn't want to even think about this until you've sorted it out with your home country.