Question: Is it permissible to drink donkey’s milk for a patient afflicted with a type of cough that, in our usage, is called “al-qahlūl”, which is a severe cough?
Answer: It is permissible in case of necessity – “except for that to which you are compelled” [al-Anʿām:119] – and Allah the Exalted has granted concession, in cases of necessity, for eating the meat of carrion; and donkey’s milk is less severely prohibited than carrion.
Source: Min Thimār al-ʿIlm wa al-Ḥikmah vol.2