Xray. It is very difficult to tell which issue is causing the pain without an x-ray of the area. Your dentist will be able to tell you which is causing the problem.
Tooth tenderness. Upper teeth pain can sometimes be caused by a problem in the maxillary sinus - but if the tooth hurts when you tap it, or if there is pain in the mouth with hot or cold liquids, it's probably a tooth problem. Your dentist can help you determine if it's your teeth. Sometimes an xray of your sinuses is needed to identify if it is a sinus problem.
Can have both. It is very common for fluid in the sinuses to cause tooth pain. If you feel head pain when you bend over, lowering your head, and / or when you take your index finger and tap your cheek below your eye, and when you tap your forehead, then you likely have sinus pain. You may want to see your dentist first to rule out tooth pain. I see many patients with sore teeth from sinuses.