What is a good way to relieve back pain from a pinched nerve?

Rest, icing. The goal is to relieve the pressure on the nerve a diminish the local inflammation. Resting in a position to relieve strain in that area is useful. Icing can be a great relief and the use of nsaids is frequently helpful. Massage is a good reliever but if the condition persists week after week or is worsening, then you need to be evaluated by your orthopod.
See your doctor. Several options. Your doctor may consider anti-inflammatory agents, steroids, or muscle relaxers. There are other classes of medications that may be used to treat pain caused by a pinched nerve (ie anti-depressants, anti-seizure medications). Your doctor may also consider sending you to physical therapy. If nothing is effective, you may need images (x-ray, ct, mri) for further evaluation.