It seems there's a generic way (i.e. not bound to a game) to play online with a local guest. When you're selecting the second player, you have to skip the profile selection part. There should be a button below the profile picture that says SKIP. This allows player two to be a guest.
When you select a profile for the guest, you will need an NSO subscription for each selected profile, or the family subscription, provided the profiles are on your list.
I found this method in a Reddit post, where they were trying to do this with Rocket League. In the comments it was confirmed to be possible, as well as several other people confirming it works the same for other games.