Islam is a universal message of love, mercy and compassion towards all the inhabitants of this globe. It is because of this that it permits a Muslim to donate an organ to a non-Muslim in case he/she is in need. Of course, priority is given to a Muslim in case a the donating Muslim is offered the choice.

Responding to the topic, the eminent Muslim scholar, Sheikh Yusuf Al-Qaradawi, states the following:

Donating an organ is like giving charity in terms of its being permissible for a Muslim or a non-Muslim. However, it is not permissible to donate an organ to a non-Muslim combatant who wages war against Muslims and a person who wages attack on Islam. By the same token, it is not permissible to donate it to an apostate as he is no more than a traitor to his religion and his people.

However, if there is a Muslim and a non-Muslim and both are in need of organ or blood donation, the Muslim must be given priority for Allah Almighty says in the Qur’an: [The Believers, men and women, are protectors one of another.] (At-Tawbah 9: 71)

Here we are to make it crystal clear that a practicing Muslim takes preference to a deviant sinful one who makes use of the divine gifts given to him to disobey Allah and harm his fellow brothers.

Also, we are to notify that if the person concerned is a relative or a neighbor, he takes great preference due to the ties of kinship or the relation of neighborhood. Allah Almighty says: [But kindred by blood have prior rights against each other in the Book of Allah.] (Al-Anfal 8: 75)
It is also noteworthy that a person can donate his/her organs to a certain person, or to an establishment such as a bank specified for that purpose.