Buy an eShop card in a physical store, you'll need to use it to buy a cheap DSiWare game on your friend's 3DS. Most DSiWare games are supported, but here's a full list:
https://3ds.guide/installing-boot9strap-(dsiware-game-injection-list)
Once you have a supported DSiWare game, you can follow this guide in order to hack your 3DS using his:
https://3ds.guide/installing-boot9strap-(dsiware-game-injection)
You will need to system transfer to your 3DS temporarily which means he will lose all the data on his 3DS for a week until you can transfer again. You can work around that by making a NAND backup on his 3DS, and restoring it after the transfer, but his NNID will still not work.
I suggest doing this so at least he can continue playing his games, and then once the week is up, make a backup of the SD card, format his 3DS then transfer back to it and restore the SD backup, to restore his NNID. His save data etc. should not be affected as long as you make a SD card backup before transferring back.
Note: To ensure he doesn't lose any data, it may be best to make a NAND backup as well on his 3DS before transferring back to it, then restoring that NAND backup.
Note, if his console is a New 3DS this won't work, because you can only system transfer n3DS consoles to other n3DS consoles.