In olden times, idolatrous non-Jews would customarily pour wine as a libation offering to their various idols and deities. This was quite a common practice. Such wine is forbidden for consumption or to derive benefit from (such as by selling it to another non-Jew) by Torah law, for anything that is included in idol worship is forbidden to benefit from.
Our Sages further decreed that even the “random wine” of non-Jews should likewise be forbidden to benefit from. This means that although one is unsure whether or not a non-Jew’s wine was offered as a libation to an idol, our Sages nevertheless decreed that one may not derive benefit from it. The reason why our Sages distanced us so much from their wine is because drinking wine brings people together in a closer way and as a result of Jews sitting together with non-Jews and drinking wine, this may bring them together to such an extent that a Jew may end up marrying a non-Jew’s daughter. It is for this reason that our Sages banned deriving any benefit from non-Jewish wine. Thus, even in our times, even “random” wine of a non-Jew is forbidden to derive benefit from and is certainly forbidden for consumption.
We must ask ourselves: Why is it that our Sages ruled so stringently and forbade even deriving benefit from non-Jewish wine, something we do not find regarding other prohibitions meant to distance us from non-Jews? The answer is that since wine that was actually poured as a libation offering is forbidden to derive benefit from as it shares the same law as an accessory to idolatry, our Sages enacted that we must treat all wine of a non-Jew as if it was certainly poured as a libation to an idol although we are uncertain of this fact. Nevertheless, as we have stated above, the primary reason for this edict was because of the concern of intermarriage.
Idolatrous Non-Jews Nowadays
We must therefore discuss the status of non-Jewish wine nowadays: Shall we consider it forbidden to derive benefit from as well or is it merely forbidden for consumption but permissible to derive benefit from?
Maran Rabbeinu Ovadia Yosef zt”l deals with this matter at length and rules that regarding this law, there is a distinction between the various non-Jewish religions. As we know, Christianity is a pagan religion, for according to their religion, Jesus is an actual deity and they serve him and pray to him. Thus, their wine takes on the law as if it were to have been offered to an idol and is forbidden to derive benefit from as well.
Nevertheless, Maran zt”l writes that wine of non-Jews that do not worship idols is only forbidden for consumption so that this does not lead to intermarriage; however, deriving benefit from such wine, such as by selling it to a non-Jew, is permissible since there is no real concern that it has been poured as an offering to foreign deities. (Conducting business with such wine on a regular basis is forbidden for other reasons.)
Regarding Muslims, we must analyze whether or not they are an idolatrous religion. Rabbeinu Nissim writes (in his commentary on Sanhedrin 61b) as follows: “We have learned that although the Ishmaelites do not make the mistake of making him (their prophet Mohammed) a god, nevertheless, since they prostate themselves to him in a divine manner, he retains the law of idolatry, for they do not only bow to him out of respect; rather, this is done in a manner of serving a deity.” Based on this, it would seem that Muslims should retain the law of idolaters.
Maran zt”l discusses this matter in several of his works and concludes that, halachically speaking, Muslims are not considered idolaters. Indeed, the Rambam writes explicitly that although they began as an idolatrous nation, as the years went by, idol worship was forgotten from them. It is apparent from them, their wives, and children that they completely affirm Hashem’s oneness in an absolute manner. Since there are other reasons for leniency that may be included here, the Halacha follows that they are not considered idolatrous and their wine is forbidden only for consumption but not to derive benefit from.
Pouring the Wine
Not only is a non-Jew’s wine forbidden for us, rather, even if a non-Jew touches our wine, the entire bottle or barrel becomes forbidden by virtue of the above rabbinic enactment. Similarly, wine poured by a non-Jew is likewise forbidden. Thus, wine touched by a Christian is forbidden to derive benefit from. However, wine touched by a Muslim is forbidden only for consumption but is permissible to derive benefit from, such as to sell it or give it as a gift to another non-Jew.
Summary: Wine belonging to Christians, who are considered idolatrous, is forbidden to derive benefit from. Thus, it cannot be sold or given as a gift to a non-Jew. Rather, it must be poured down the drain. Nevertheless, wine belonging to Arabs or other Muslims is not forbidden to derive benefit from and is only forbidden for consumption as a result of the rabbinic concern of intermarriage. Their touching of our wine or pouring it into our cup likewise prohibits the wine for consumption, as is customary.