The Torah: That which is hateful to you, do not do to your fellow.
Islam: The Prophet said: None of you will have faith till he wishes for his (Muslim) brother what he likes for himself. [Bukhari Vol. 1, Book 2, No. 12]
Comparing the three sentences above, we can see that the Islamic golden rule is not universal since it applies only to Muslims. Other Islamic texts (Hadith) clarify the limitation of reciprocity to relations between Muslim brothers:
Allah's Apostle said: A Muslim is a brother of another Muslim. So he should neither oppress him nor hand him over to an oppressor. And whoever fulfilled the needs of his brother, Allah will fulfill his needs. [Bukhari Vol. 9, Book 85, No. 83]
Allah's Apostle said: Abusing a Muslim is Fusuq (i.e., an evil-doing), and killing him is Kufr (disbelief). [Bukhari Vol. 8, Book 73, No. 70]
The Qur’an itself makes it very clear that brotherhood applies only towards other Muslims, for example:
Muhammad is the messenger of Allah; and those who are with him are strong against Unbelievers, (but) compassionate amongst each other. [Qur'an 48:29]