This is the symptom of a weakened iPhone battery that is failing (especially on iOS 10). My recommendation is to determine your battery's current capacity and health by downloading a couple of battery health apps. You can monitor your battery health to determine if you need to replace the battery soon.
If replacement is needed but your iPhone is not under warranty or AppleCare, you can replace the battery yourself for about $35 (battery and proper tools). I was having these issues with my iPhone 6+ and replaced the battery which was not too difficult. My phone is like new now.