It is certainly a pickle. I suggest trying to log into your NNID on the working system using the working 2DS as a guide/reference for the keyboard prompts, it won’t work but if you have the right password it should let you know by saying “this account is already linked to another system”. I think. I haven’t tried it myself.
There is a way to stream the screens on old 3DS systems with HzMod, but it is very unstable & a last resort. More info here:
https://wiki.hacks.guide/wiki/3DS:Wireless_streaming
Once you get your system’s IP address, then click on the HzMod hyperlink.
If you only want the NNID & don’t care about any data on the system (though some could be salvaged with homebrew apps, not sure about StreetPass history), you could call Nintendo support & if you provide sufficient proof that you are the owner of the account, they should be able to help you. It’s what I did when I sold my Wii U, and then bought another one for cheaper in 2018.
Though honestly, I’d probably just recommend getting a replacement screen. The old 2DS assembly is a single unit since the device isn’t clamshell, so you’d be replacing the top one as well. Here’s a guide with pics, and you can get them for $60-$70 on Amazon. I get it if it seems too daunting,but if you do send it to a repair shop, make sure it’s a good one like Computer Booter, not some cheapo, payment-up-front, no refunds “shop” that specializes just in HDMI port replacements & has a Hakko cuz everyone else does but probably couldn’t tell you the polarity ends of a multimeter. (I’m bitter from personal experience)