It's pretty simple. Just go to system settings, then tap the top where it says nintendo network ID settings. After that, go to the last page and tap other. There is an option to delete the NNID.
This is from Nintendo's website.
"Nintendo 3DS family systems can only support one Nintendo Network ID at a time. However, you can format the system to deactivate the current NNID and create a new one. (The existing account and purchases will not be deleted, and can still be re-linked to the same system in the future.)"
According to that, you should be able to format both 3DS systems and the NNID's will be unlinked from them (not gone, just not connected to those 3DS anymore). After that, linking the one you want to use should be simple as long as you remember your NNID name and password. If that doesn't work, then a system transfer is probably the only way.