Can teeth underneath the gums that need to be extracted be the cause of facial and ear pain?

Absolutely. Trigeminal nerve covers most of face. Upper teeth are innervated by the maxillary branch (pink area) & lower teeth by the mandibular branch (yellow area). As you can see these areas extend to temple area as well as area in front of ears. So bad teeth can cause referred pain in those areas. See a dentist soon for treatment & relief.