While I am sure this is true in many cases, my personal experience was the opposite. I had significant nerve pain after an accident, which kept me from being able to sleep or focus on anything very well.
The physician I saw after my hospitalization was apparently worried I was trying to satisfy a drug-craving? So instead of giving me a pain-killer gave me a prescription for an anti-depressant (which potentially treats nerve pain at 4X the normal dose used to treat depression) - withdrawal from that was extremely bad and certainly much worse than anything I've experienced after pain-killers.