... where do I configure it as player 2, in Mame or in Windows?
To configure it to player2, I'd use the ctrlr ini files.
EasyEmu and docs/ctrlr.txt in your mame folder has a lot of info on using ctrlr ini files. Assuming the removable joystick is the only joystick you have plugged in, you'll want to remove all the joy1...code from player 1, and move them to player 2 instead.
Another choice is to have an unused joystick plugged in all the time and
installed first, so that the removable joystick, when plugged in, is joystick 2 to windows.
Last choice is edit, ingame, "Inputs (general)" so player2 uses the joystick, and player1 (like in ctrlr ini files, but through, IMO, a worse path.)