This problem sounds little strange but most probably while brushing you would have forced something inside the gums which has led to this pain.
Next Steps
You can take tab ketorol-DT two tablets in half a glass of water and then immediately visit a nearby gum specialist.
Health Tips
Keep your tooth brush clean, practice proper brushing technique and change your tooth brush every 3 months.