This is a difficult issue to correlate! you've received many very good answers.
If you've seen a dentist and they told you about the infection, they have probably recommended treatment. It may be wise to follow through with this treatment recommendation and see if it resolves. If it doesn't you'll at least know that it's not related to the gums. It can be frustrating but hang in there!