A cartridge game is just encrypted, but in such a way that it will work on any console. You dump the cartridge, still encrypted exactly as it is, and it will run on gateway in any console (that gateway works on).
An eshop game is encrypted to only work on a specific console. You dump it as it is, it won't work on any other console.
You'd have to decrypt it, and then re-encrypt it in such a way as it will run on any gateway console (turning them into a .3ds file is how this has been done, and has also required gateway to patch the firmware so that it doesn't care that the game was encrypted by someone else other than nintendo).