Uses: This medication is used to help relieve moderate to severe ongoing pain (such as due to cancer). Fentanyl belongs to a class of drugs known as narcotic (opiate) analgesics. It works in the brain to change how your body feels and responds to pain.