It might not work by only switching the power, but the only way to find out is to try.
But I believe you could get away with only switching a few pins if power alone isn't enough.
Looking at
http://3dbrew.org/wiki/Gamecards
The clock pin (pin 2) and IRQ cartridge removal detection (pin 7) are of special interest. Pins 4 and 5 (ROM select and reset) and pin 6 (save chip select) could also need to be switched. If none of those are connected and power (pin 8) isn't connected, the 3DS shouldn't even be able to tell that there is something connected, because the rest of the pins are just for the data bus, and that does nothing without the clock signal to drive it.
But hopefully you only need to switch the power and maybe the clock. Not switching the IRQ pin could cause some issues with the 3DS detecting when you insert or unplug a cartridge, since it will always see a cart on that pin. That is as long as it uses dumb detection that doesn't require the cartridge to actually be powered.
You can get switches that can switch multiple inputs. 4PDT has 4 pins that can be switched to A or B (12 pins in total, 4 for the input and 4 for each output), 5PDT is 5 pins, etc. DPDT is 2 pins switched between A and B. I would suggest 3PDT at least, to make sure you can switch the clock pin and IRQ pin if needed.
The more pins the switch has, the larger it's going to have to be, so it may be difficult to find a switch with enough pins that will actually fit inside the 3DS.
Actually fitting the flashcart inside the 3DS might be difficult. You'll have to remove the bare PCB and solder to the cartridge contacts, with the switch in the middle, and solder the other ends directly to the cartridge slot contacts on the 3DS mainboard, or if you can find test points for the cartridge slot on the 3DS mainboard that would be easier. If you want to not have to remove the cartridge that's inserted in order to use the flashcart, you also have to desolder the pins on the cartridge slot, or alternatively cut the traces if possible, so that they aren't permanently connected to the board, and they only go through the switch.
There isn't much room inside the 3DS and the flashcart PCB will be at least 3mm or so. You may have to cut some of the back casing (underneath the battery lid) and put the cart there. Which has the bonus of making the MicroSD slot on the flashcart more easily accessible so you don't have to disassemble the console just to add games to it.