Praise be to Allah.
Shaykh ‘Abd al-‘Aziz ibn Baz (May Allah have mercy on him) was asked,
If a person suffers pain in his teeth and he goes to the dentist who cleans them or does a filling or extracts one of his teeth , does that affect his fast? If the dentist gives him an injection to anaesthetize his tooth , does that affect his fast?
The things mentioned in this question do not have any effect on the validity of the fast; rather that is allowed. But he has to be careful not to swallow any medicine or blood.
Similarly, the injection mentioned does not affect the validity of the fast because it is not a kind of food or drink, and the basic principle is that his fast is valid. (Ajwibah Muhimmah tata’allaq bi Arkan al-Islam).
If you can go to the dentist in the evening, this is preferable.
And Allah knows best.