Allaah has enjoined kind treatment of neighbours in the Qur'aan (interpretation of the meaning): "Worship Allaah and join none with Him in worship, and do good to parents, kinsfolk, orphans, the poor, the neighbour who is near of kin, the neighbour who is a stranger, the companion by your side, the wayfarer (you meet), and those slaves whom your right hands possess. Verily, Allaah does not like such as are proud and boastful." [al-Nisaa' 4:36]
Harming a neighbour is haraam because of the greatness of his rights. Abu Shurayh (may Allaah be pleased with him) reported that the Prophet (peace and blessings of Allaah be upon him) said: "By Allaah, he does not believe, by Allaah, he does not believe, by Allaah, he does not believe." He was asked, "Who, O Messenger of Allaah?" He said: "The one from whose harm his neighbour is not safe." (Reported by al-Bukhaari, see Fath al-Baari, 10/443)
The Prophet (peace and blessings of Allaah be upon him) regarded the praise or criticism of a neighbour as a measure of a person's goodness or badness. Ibn Mas'ood (may Allaah be pleased with him) reported that a man said to the Prophet (peace and blessings of Allaah be upon him): "O Messenger of Allaah, how may I know if I am doing well or not?" The Prophet (peace and blessings of Allaah be upon him) said: "If you hear your neighbour say that you are good, then you are doing well, and if you hear him saying that you are bad, you are not doing well." (Reported by Imaam Ahmad, 1/402, see also Saheeh al-Jaami', 623).
Harming a neighbour may take many forms, including: not allowing him to fix a piece of wood to a shared wall or fence; expanding one's dwelling in such a way as to deprive him of sun or air without his permission; opening windows overlooking his house and looking out of them to invade his privacy; disturbing him with loud sounds such as hammering or shouting, especially when he is asleep or resting; or throwing trash in front of his door. The sin of such deeds is increased when they are done to a neighbour, as the Prophet (peace and blessings of Allaah be upon him) said: "If a man were to commit adultery with ten women, it would be better for him than committing adultery with the wife of his neighbour, and if a man were to steal from ten houses, it would be better for him than stealing from the house of his neighbour." (Reported by al-Bukhaari in al-Adab al-Mufrad, no. 103; see also al-Silsilah al-Saheehah, 65). Some treacherous people take advantage of a neighbour's absence during his night shift to enter his house and commit immoral acts. Woe to them of the punishment of a painful Day!