Answer
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
It is not permissible to consume alcohol to reduce the effects of pain attack. Using sedative medicine is not equal to consuming alcohol. Medicine is used to cure the body with little unintentional or no side effects which cannot be said for alcohol and drugs.
Answering your question, Dar Al-Ifta Al-Misriyyah, states:
Islam prohibits alcohol due to its intoxicating nature that produces a depressive effect on the central nervous system causing a range of mental impairments. Since religious rituals are tied to the soundness of a person’s intellectual ability, any impairment in this area resulting from the consumption of alcoholic beverages or non-medical drugs is prohibited in Islam.
The side effects of alcohol such as relief of pain or tension are the byproducts of drinking and this soothing effect comes at the cost of many hazardous health risks.
Alcohol is not manufactured for curative purposes and cannot be used for medical treatment. It is prohibited to replace sedative medication with alcohol under the premise of having the same soothing effects since the former is mainly manufactured for reducing pain while the latter is not.
Consequently, using sedative medicine is not equal to consuming alcohol since medicine is used to cure the body with little unintentional or no side effects which cannot be said for alcohol and drugs. The consumption of alcohol is, therefore, emphatically prohibited.
Almighty Allah knows best.
Source: Dar Al-Ifta Al-Misriyyah