Generally, you shouldn't disclose your salary, as it gives away your negotiation power. If they ask you to disclose, you should refuse. I'd recommend the following resources on salary negotiation for developers:
Personally, I think it is shortsighted for the company to lowball you like that. If you do take the position at that salary, the company will relocate you, only to have you change companies within six months to another position that pays you twice as much.
From your GitHub profile, I know you're the author of reasonably well used Python libraries. This should be enough to get your foot in the door to any company that's using Python. Based on that alone, I'm guessing that a salary of ¥5 million would still be on the lower side of things, and one of ¥7 million plus not being unreasonable.
So if I were in your shoes, I'd counter to the company that ¥3 million is way below your market value in Japan (which is not tied to your previous salary). If you're joining that company, you want to be able to continue to work with them for the longer term. If they were to hire you at that salary, you think you'd quickly be poached by another company who will offer you a significantly better salary. Especially because once you are working in Japan as a developer, you'll have a lot more opportunities. So if you're going to work for that company, you need to start from a market salary in the beginning. Based on your research, ¥7 million seems to be a reasonable salary for an experienced developer like yourself.
The key thing is to be prepared to walk away. Personally, I think you'll probably be able to get better offers elsewhere, and lowballing you like that is a negative signal to me. Ultimately, it is your call though. If you do end up taking a lower salary, I just remember you don't owe them any loyalty, and I'd continue to search for a better job here.