When the benefits outweigh the risks then yes, you can take it. Sounds like you have reasonable reasons to take it.
But remember that ANYTHING you ingest, digest, put on your skin, breathe in- all get passed to baby.
Your pharmacist is correct that medication is safe to use during pregnancy, i'm sure he is not just trying to sell you something. so don't worry
I am sure your Dentist could give you a safe alternative medication. TMJ is what I think you are referring to and it is VERY common.Is your dentist aware you are pregnant? I personally would NOT be taking the medicine you described above while pregnant, but in terms of the safeness, I would call your doctor or dentist. I am not a big fan of meds unless they are necessary... And it seems like you are combining meds and I am no pharmacist. I think you need to speak to your Dr./Dentist (whomever advised you about the meds you are taking, and recommended them?) Keep us posted!
I would talk with your doctor before you take any medication.