This, too, is part of the religion brought by Muhammad ﷺ. Allah, Exalted is He, says: “O you who believe, do not take the Jews and the Christians as allies; they are allies of one another. Whoever among you allies himself with them is truly one of them. Allah does not guide the wrongdoing people.” (Al-Maʾidah 51)
This verse is a specific prohibition against allying with the People of the Scripture. As for the ban on allying with the disbelievers in general, He says: “O you who believe, do not take My enemies and your enemies as allies.” (Al-Mumtahana 1)
Indeed, Allah has forbidden the believer to ally himself with the disbelievers even when they are his closest blood relatives. He, Exalted is He, says: “O you who believe, do not take your fathers and your brothers as allies if they prefer disbelief to faith. Whoever among you allies himself with them—such people are the wrongdoers.” (Al-Tawbah 23)
And He, Exalted is He, says: “You will not find a people who believe in Allah and the Last Day…”