According to this Nintendo Support article, you cannot directly use the account you set up with your 3DS. A 3DS system uses an account that is tied to a Nintendo Network ID, which functions differently than accounts tied to a Switch.
Nintendo Accounts and Nintendo Network IDs are used for different purposes.
- A Nintendo Account is used for Nintendo Switch online services (including the Nintendo Switch eShop), smart device applications (like Super Mario Run), off-device software purchases, and the My Nintendo loyalty service.
Nintendo Network ID
- A Nintendo Network ID (NNID) is created and used on a Wii U and/or Nintendo 3DS family system.
- NNIDs are used for online features (such as online multiplayer or interactions) and for purchasing downloadable software through Nintendo eShop on Wii U and Nintendo 3DS
You can link your 3DS account to your Switch account, which this article provides information on how to do that. The benefit for linking your accounts provides the ability to share funds between your systems.
Additionally, a Nintendo Network ID can be linked to a Nintendo Account to share Nintendo eShop funds across the different systems.