حَدَّثَنَا مُحَمَّدُ بْنُ مِنْهَالٍ حَدَّثَنَا يَزِيدُ بْنُ زُرَيْعٍ حَدَّثَنَا عُمَرُ بْنُ مُحَمَّدٍ عَنْ أَبِيهِ عَنْ ابْنِ عُمَرَ رَضِيَ اللَّهُ عَنْهُمَا قَالَ قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ مَا زَالَ جِبْرِيلُ يُوصِينِي بِالْجَارِ حَتَّى ظَنَنْتُ أَنَّهُ سَيُوَرِّثُهُ البخاري
"Jibreel kept enjoining me regarding neighbors until I began to think that they would be given a share of inheritance." (Bukhari)
A neighbor is by 1) closeness of dwellings, 2) mingling by means of a common masjid, school, market, etc.
These rights are especially strong for a Muslim neighbor, and existing for a non-Muslim neighbot.
Rights of the neighbor include the pious Muslim, the corrupt Muslim and the non-Muslim.
The obligation of goodness and kindness may be stronger with the last two for the purpose of da'wah - the ultimate and primary purpose of all interaction.
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ حَدَّثَنَا أَبُو الْأَحْوَصِ عَنْ أَبِي حُصَيْنٍ عَنْ أَبِي صَالِحٍ عَنْ أَبِي هُرَيْرَةَ قَالَ قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ مَنْ كَانَ يُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الْآخِرِ فَلَا يُؤْذِي جَارَهُ وَمَنْ كَانَ يُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الْآخِرِ فَلْيُكْرِمْ ضَيْفَهُ وَمَنْ كَانَ يُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الْآخِرِ فَلْيَقُلْ خَيْرًا أَوْ لِيَسْكُتْ و حَدَّثَنَا إِسْحَقُ بْنُ إِبْرَاهِيمَ أَخْبَرَنَا عِيسَى بْنُ يُونُسَ عَنْ الْأَعْمَشِ عَنْ أَبِي صَالِحٍ عَنْ أَبِي هُرَيْرَةَ قَالَ قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ بِمِثْلِ حَدِيثِ أَبِي حَصِينٍ غَيْرَ أَنَّهُ قَالَ فَلْيُحْسِنْ إِلَى جَارِهِ
"Whoever believe in Allah and the Last Day, let him not annoy his neighbor. Whoever believes in Allah and the Last Day, let him honor his guest. Whoever believes in Allah and the Last Day, let him speak that which is good or just keep quiet." In another version, the wording was: "...let him do good to his neighbor." (Muslim, Bukhari and others with various wording.)
Ibn Umar (ra) said: "A time has come upon us when no one was more deserving of one's dinars or dirhams than a brother Muslim. But now, dinars and dirhams have become more beloved to one of us than his brother Muslim. I heard the Prophet (sas) say, 'How many neighbors will be kept hanging by his neighbor on Qiyama! He says, O Lord! This one closed his door on me and withheld his favors from me."
"A believer does not fill his stomach while his neighbor is hungry."