You can check with your primary care, doctor, however, I have never heard of sumatriptan being a contraindication prior to surgery. It’s more important that you relieve yourself of your migraines and get good rest prior to your surgery and after your surgery. Best wishes.
While it is likely okay for you to take this medication five days prior to your surgery the best person to ask is your surgeon. She/He should be aware of all medications you are taking including prescription, over the counter and supplements. Your surgeon will inform you which are okay to continue and which need to be stopped prior to surgery.