Hello,
The pain is due to the overgrown gums(Operculum) on the wisdom tooth. This condition is called Pericoronitis.
It has to be removed , but even after removal, it grows back most of the time.
Next Steps
Visit a dentist for removal of the operculum by cautery.
Health Tips
If the condition persists, it would be best to remove the wisdom tooth. Discuss with your dentist about that.