Avoiding tax on remittance via gifts/loans

As a yet non-permanent tax resident, I'd like to get some extra cash in this year. But I also plan to sell stocks abroad this year, which will trigger capital gains. I can sell them once and the gains won't be taxed because I bought them before coming to Japan.

The problem is, if I sell them this year and transfer money (even from other sources/savings) it will trigger tax on the remittance value from my understanding, or does it not because it is not income? (I had no foreign sourced income this year)

If it does trigger tax, could I have my friend loan me money and send it to me and I'll pay him back with a small interest next year to avoid any tax?

by AmumboDumbo