What are the responsibilities of a good neighbour? According to Quran and Sunnah

Responsibilities of a good neighbour
Humans are social creatures. It is human nature to live socially. Everyone is dependent on each other. Allah created man with different qualities. Everyone has to go for more or less every need. The great Lord Almighty has described the mutual rights and duties of human beings with different responsibilities. As Allah Ta'ala says,
وَاعۡبُدُوا اللّٰہَ وَلَا تُشۡرِکُوۡا بِہٖ شَیۡئًا وَّبِالۡوَالِدَیۡنِ اِحۡسَانًا وَّبِذِی الۡقُرۡبٰی وَالۡیَتٰمٰی وَالۡمَسٰکِیۡنِ وَالۡجَارِ ذِی الۡقُرۡبٰی وَالۡجَارِ الۡجُنُبِ وَالصَّاحِبِ بِالۡجَنۡۢبِ وَابۡنِ السَّبِیۡلِ ۙ  وَمَا مَلَکَتۡ اَیۡمَانُکُمۡ ؕ  اِنَّ اللّٰہَ لَا یُحِبُّ مَنۡ کَانَ مُخۡتَالًا فَخُوۡرَا ۙ 
Worship Allah and associate nothing with Him, and to parents do good, and to relatives, orphans, the needy, the near neighbor, the neighbor farther away, the companion at your side, the traveler, and those whom your right hands possess. Indeed, Allah does not like those who are self-deluding and boastful.
(Surah An-Nisaa 4:36)

Who are the neighbors?
A hadith can be mentioned about who are the neighbors.
حَدَّثَنَا الْحُسَيْنُ بْنُ حُرَيْثٍ، قَالَ‏:‏ حَدَّثَنَا الْفَضْلُ بْنُ مُوسَى، عَنِ الْوَلِيدِ بْنِ دِينَارٍ، عَنِ الْحَسَنِ، أَنَّهُ سُئِلَ عَنِ الْجَارِ، فَقَالَ‏:‏ أَرْبَعِينَ دَارًا أَمَامَهُ، وَأَرْبَعِينَ خَلْفَهُ، وَأَرْبَعِينَ عَنْ يَمِينِهِ، وَأَرْبَعِينَ عَنْ يَسَارِهِ‏.‏
Al-Hasan was asked about the neighbour and said, "The term 'neighbour' includes the forty houses in front a person, the forty houses behind him, the forty houses on his right and the forty houses on his left."
Hasan (Al-Albani)
Al-Adab Al-Mufrad 109 
In-book : Book 6, Hadith 9 
English translation : Book 6, Hadith 109
Al-Adab Al-Mufrad

Types of neighbors
A) Relative Muslim neighbors
B) Muslim neighbors
C) Non-Muslim neighbors

A) Relative Muslim neighbors
The rights of this class of neighbors are from three sides. The first is that he is a Muslim, the second is a neighbor and the third is a relative. Therefore, while asserting his rights, We should keep in mind that he deserves three kinds of rights.

B) Muslim neighbors
The rights of this class of neighbors are from two sides. Firstly he is a Muslim and secondly he is a neighbor. Therefore, while exercising his rights, one should keep in mind that he deserves two kinds of rights.

C) Non-Muslim neighbors
This class of neighbors has a right. That person lives as a neighbor so he has to take care of her, cooperate with her as a neighbor. That is, he lives in the society, so he deserves all the social rights.

The importance of good manners with neighbors
Neighbors must be protected. The Prophet (peace and blessings of Allaah be upon him) said about treating him well,
حَدَّثَنَا إِسْمَاعِيلُ بْنُ أَبِي أُوَيْسٍ، قَالَ حَدَّثَنِي مَالِكٌ، عَنْ يَحْيَى بْنِ سَعِيدٍ، قَالَ أَخْبَرَنِي أَبُو بَكْرِ بْنُ مُحَمَّدٍ، عَنْ عَمْرَةَ، عَنْ عَائِشَةَ ـ رضى الله عنها ـ عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏مَا زَالَ يُوصِينِي جِبْرِيلُ بِالْجَارِ حَتَّى ظَنَنْتُ أَنَّهُ سَيُوَرِّثُهُ ‏"
Narrated `Aisha: The Prophet (ﷺ) said "Gabriel continued to recommend me about treating the neighbors Kindly and politely so much so that I thought he would order me to make them as my heirs.
Sahih al-Bukhari 6014 
In-book : Book 78, Hadith 45 
USC-MSA web (English) : Vol. 8, Book 73, Hadith 43  (deprecated)
Sahih Bukhari

In another hadith, the beloved Prophet (peace be upon him) said:
حَدَّثَنَا أَحْمَدُ بْنُ مُحَمَّدٍ، حَدَّثَنَا عَبْدُ اللَّهِ بْنُ الْمُبَارَكِ، عَنْ حَيْوَةَ بْنِ شُرَيْحٍ، عَنْ شُرَحْبِيلَ بْنِ شَرِيكٍ، عَنْ أَبِي عَبْدِ الرَّحْمَنِ الْحُبُلِيِّ، عَنْ عَبْدِ اللَّهِ بْنِ عَمْرٍو، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏خَيْرُ الأَصْحَابِ عِنْدَ اللَّهِ خَيْرُهُمْ لِصَاحِبِهِ وَخَيْرُ الْجِيرَانِ عِنْدَ اللَّهِ خَيْرُهُمْ لِجَارِهِ ‏" قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ غَرِيبٌ ‏‏ وَأَبُو عَبْدِ الرَّحْمَنِ الْحُبُلِيُّ اسْمُهُ عَبْدُ اللَّهِ بْنُ يَزِيدَ ‏‏
Abdullah bin Amr narrated that the Messenger of Allah said : "The companion who is the best to Allah is the one who is best to his companion. And the neighbor that is the best to Allah is the one that is best to his neighbor."
Sahih (Darussalam)
Jami` at-Tirmidhi 1944 
In-book : Book 27, Hadith 50 
English translation : Vol. 4, Book 1, Hadith 1944
Jamiat Tirmidhi

Neighbor's rights

A) Good behavior
One of the rights of neighbors is to treat them well. The Prophet (peace and blessings of Allaah be upon him) said,
حَدَّثَنَا زُهَيْرُ بْنُ حَرْبٍ، وَمُحَمَّدُ بْنُ عَبْدِ اللَّهِ بْنِ نُمَيْرٍ، جَمِيعًا عَنِ ابْنِ عُيَيْنَةَ، - قَالَ ابْنُ نُمَيْرٍ حَدَّثَنَا سُفْيَانُ، - عَنْ عَمْرٍو، أَنَّهُ سَمِعَ نَافِعَ بْنَ جُبَيْرٍ، يُخْبِرُ عَنْ أَبِي شُرَيْحٍ الْخُزَاعِيِّ، أَنَّ النَّبِيَّ صلى الله عليه وسلم قَالَ ‏مَنْ كَانَ يُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الآخِرِ فَلْيُحْسِنْ إِلَى جَارِهِ وَمَنْ كَانَ يُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الآخِرِ فَلْيُكْرِمْ ضَيْفَهُ وَمَنْ كَانَ يُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الآخِرِ فَلْيَقُلْ خَيْرًا أَوْ لِيَسْكُتْ ‏"
It is narrated on the authority of Abu Shuraih al-Khuzai' that the Prophet (ﷺ) observed: He who believes in Allah and the Last Day should do good to his neighbour and he who believes in Allah and the Last Day should show hospitality to the guest and he who believes in Allah and the Last Day should either speak good or better remain silent.
Sahih Muslim 48 
In-book : Book 1, Hadith 83 
USC-MSA web (English) : Book 1, Hadith 78  (deprecated)
Sahih Muslim

B) Not to be abused
Can't be used that hurts neighbors. It is narrated in Hadith,
حَدَّثَنَا إِسْحَاقُ بْنُ نَصْرٍ، حَدَّثَنَا حُسَيْنٌ الْجُعْفِيُّ، عَنْ زَائِدَةَ، عَنْ مَيْسَرَةَ، عَنْ أَبِي حَازِمٍ، عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏مَنْ كَانَ يُؤْمِنُ بِاللَّهِ وَالْيَوْمِ الآخِرِ فَلاَ يُؤْذِي جَارَهُ ‏" وَاسْتَوْصُوا بِالنِّسَاءِ خَيْرًا فَإِنَّهُنَّ خُلِقْنَ مِنْ ضِلَعٍ وَإِنَّ أَعْوَجَ شَيْءٍ فِي الضِّلَعِ أَعْلَاهُ فَإِنْ ذَهَبْتَ تُقِيمُهُ كَسَرْتَهُ وَإِنْ تَرَكْتَهُ لَمْ يَزَلْ أَعْوَجَ فَاسْتَوْصُوا بِالنِّسَاءِ خَيْرًا
Narrated Abu Huraira: The Prophet (ﷺ) said, "Whoever believes in Allah and the Last Day should not hurt (trouble) his neighbor. And I advise you to take care of the women, for they are created from a rib and the most crooked portion of the rib is its upper part; if you try to straighten it, it will break, and if you leave it, it will remain crooked, so I urge you to take care of the women."
Sahih al-Bukhari 5185, 5186 
In-book : Book 67, Hadith 120 
USC-MSA web (English) : Vol. 7, Book 62, Hadith 114  (deprecated)
Sahih Bukhari

C) Feeding the hungry
حَدَّثَنَا مُحَمَّدُ بْنُ كَثِيرٍ، قَالَ‏:‏ أَخْبَرَنَا سُفْيَانُ، عَنْ عَبْدِ الْمَلِكِ بْنِ أَبِي بَشِيرٍ، عَنْ عَبْدِ اللهِ بْنِ الْمُسَاوِرِ قَالَ‏:‏ سَمِعْتُ ابْنَ عَبَّاسٍ يُخْبِرُ ابْنَ الزُّبَيْرِ يَقُولُ‏:‏ سَمِعْتُ النَّبِيَّ صلى الله عليه وسلم يَقُولُ‏:‏ لَيْسَ الْمُؤْمِنُ الَّذِي يَشْبَعُ وَجَارُهُ جَائِعٌ‏.‏
Ibn 'Abbas told Ibn az-Zubayr, "I heard the Prophet (ﷺ) say, 'A man is not a believer who fills his stomach while his neighbour is hungry.'"
Sahih (Al-Albani)
Al-Adab Al-Mufrad 112 
In-book : Book 6, Hadith 12 
English translation : Book 6, Hadith 112
Al-Adab Al-Mufrad

حَدَّثَنَا أَحْمَدُ بْنُ مَنِيعٍ، وَعَلِيُّ بْنُ حُجْرٍ، قَالاَ حَدَّثَنَا سُفْيَانُ بْنُ عُيَيْنَةَ، عَنْ جَعْفَرِ بْنِ خَالِدٍ، عَنْ أَبِيهِ، عَنْ عَبْدِ اللَّهِ بْنِ جَعْفَرٍ، قَالَ لَمَّا جَاءَ نَعْىُ جَعْفَرٍ قَالَ النَّبِيُّ صلى الله عليه وسلم اصْنَعُوا لأَهْلِ جَعْفَرٍ طَعَامًا فَإِنَّهُ قَدْ جَاءَهُمْ مَا يَشْغَلُهُمْ ‏" قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ ‏‏ وَقَدْ كَانَ بَعْضُ أَهْلِ الْعِلْمِ يَسْتَحِبُّ أَنْ يُوَجَّهَ إِلَى أَهْلِ الْمَيِّتِ شَيْءٌ لِشُغْلِهِمْ بِالْمُصِيبَةِ ‏‏ وَهُوَ قَوْلُ الشَّافِعِيِّ ‏‏ قَالَ أَبُو عِيسَى وَجَعْفَرُ بْنُ خَالِدٍ هُوَ ابْنُ سَارَةَ وَهُوَ ثِقَةٌ رَوَى عَنْهُ ابْنُ جُرَيْجٍ ‏‏
Abdullah bin Ja'far said: "When the news of the death of Ja'far came, the Prophet said: 'Prepare some food for the family of Ja'far, for indeed something has happened to them that will keep them busy.'"
Hasan (Darussalam)
Jami` at-Tirmidhi 998 
In-book : Book 10, Hadith 34 
English translation : Vol. 2, Book 5, Hadith 998
Jamiat Tirmidhi

D) Expressing sympathy in danger
It is essential for everyone to help, sympathize, comfort and give honest advice when a neighbor is in danger. The Prophet (peace and blessings of Allaah be upon him) said:
حَدَّثَنَا يُوسُفُ بْنُ عِيسَى، حَدَّثَنَا عَلِيُّ بْنُ عَاصِمٍ، قَالَ حَدَّثَنَا وَاللَّهِ، مُحَمَّدُ بْنُ سُوقَةَ عَنْ إِبَرْاهِيمَ، عَنِ الأَسْوَدِ، عَنْ عَبْدِ اللَّهِ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ‏ مَنْ عَزَّى مُصَابًا فَلَهُ مِثْلُ أَجْرِهِ ‏" قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ غَرِيبٌ لاَ نَعْرِفُهُ مَرْفُوعًا إِلاَّ مِنْ حَدِيثِ عَلِيِّ بْنِ عَاصِمٍ ‏‏ وَرَوَى بَعْضُهُمْ عَنْ مُحَمَّدِ بْنِ سُوقَةَ بِهَذَا الإِسْنَادِ مِثْلَهُ مَوْقُوفًا وَلَمْ يَرْفَعْهُ ‏‏ وَيُقَالُ أَكْثَرُ مَا ابْتُلِيَ بِهِ عَلِيُّ بْنُ عَاصِمٍ بِهَذَا الْحَدِيثِ نَقَمُوا عَلَيْهِ ‏‏
Abdullah narrated that: The Prophet said: "Whoever consoles a person with an affliction, then he gets the same reward as him."
Da'if (Darussalam)
Jami` at-Tirmidhi 1073 
In-book : Book 10, Hadith 109 
English translation : Vol. 2, Book 5, Hadith 1073
Jamiat Tirmidhi

E) To show patience in the hardships given by the neighbor
If the neighbor hurts, treat him well so that he can understand his mistake. The Prophet (peace and blessings of Allaah be upon him) said:
حَدَّثَنَا يَحْيَى بْنُ يَحْيَى، قَالَ قَرَأْتُ عَلَى مَالِكٍ عَنِ ابْنِ شِهَابٍ، عَنِ الأَعْرَجِ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏لاَ يَمْنَعْ أَحَدُكُمْ جَارَهُ أَنْ يَغْرِزَ خَشَبَةً فِي جِدَارِهِ ‏" قَالَ ثُمَّ يَقُولُ أَبُو هُرَيْرَةَ مَا لِي أَرَاكُمْ عَنْهَا مُعْرِضِينَ وَاللَّهِ لأَرْمِيَنَّ بِهَا بَيْنَ أَكْتَافِكُمْ ‏‏

Abu Huraira (Allah be pleased with him) reported Allah's Messenger (ﷺ) as saying: None among you should prevent his neighbour from fixing a beam in his wall. Abu Huraira (Allah be pleased with him) then said: What is this that I see you evading (this injunction of the Holy Prophet)? By Allah, I will certainly throw it between your shoulders (narrate this to you.)
Sahih Muslim 1609 a 
In-book : Book 22, Hadith 169 
USC-MSA web (English) : Book 10, Hadith 3918  (deprecated)
Sahih Muslim

Consequences of mistreatment of neighbors

A) Not a believer who misbehaves with his neighbor
Neighbors cannot be treated badly, even if they belong to another religion. From an Islamic point of view, mistreatment of neighbors is a heinous act. The Prophet (peace and blessings of Allaah be upon him) said:
حَدَّثَنَا عَاصِمُ بْنُ عَلِيٍّ، حَدَّثَنَا ابْنُ أَبِي ذِئْبٍ، عَنْ سَعِيدٍ، عَنْ أَبِي شُرَيْحٍ، أَنَّ النَّبِيَّ صلى الله عليه وسلم قَالَ ‏‏ وَاللَّهِ لاَ يُؤْمِنُ، وَاللَّهِ لاَ يُؤْمِنُ، وَاللَّهِ لاَ يُؤْمِنُ ‏"‏‏.‏ قِيلَ وَمَنْ يَا رَسُولَ اللَّهِ قَالَ ‏"‏ الَّذِي لاَ يَأْمَنُ جَارُهُ بَوَايِقَهُ ‏"‏‏.‏ تَابَعَهُ شَبَابَةُ وَأَسَدُ بْنُ مُوسَى‏.‏ وَقَالَ حُمَيْدُ بْنُ الأَسْوَدِ وَعُثْمَانُ بْنُ عُمَرَ وَأَبُو بَكْرِ بْنُ عَيَّاشٍ وَشُعَيْبُ بْنُ إِسْحَاقَ عَنِ ابْنِ أَبِي ذِئْبٍ، عَنِ الْمَقْبُرِيِّ، عَنْ أَبِي هُرَيْرَةَ،‏.‏"
Narrated Abu Shuraih: The Prophet (ﷺ) said, "By Allah, he does not believe! By Allah, he does not believe! By Allah, he does not believe!" It was said, "Who is that, O Allah's Messenger (ﷺ)?" He said, "That person whose neighbor does not feel safe from his evil."
Sahih al-Bukhari 6016 
In-book : Book 78, Hadith 47 
USC-MSA web (English) : Vol. 8, Book 73, Hadith 45  (deprecated)
Sahih Bukhari

B) Obstacles to entering Paradise
A person who misbehaves with his neighbor will not be able to enter Paradise. The Prophet (peace and blessings of Allaah be upon him) said:
حَدَّثَنَا يَحْيَى بْنُ أَيُّوبَ، وَقُتَيْبَةُ بْنُ سَعِيدٍ، وَعَلِيُّ بْنُ حُجْرٍ، جَمِيعًا عَنْ إِسْمَاعِيلَ بْنِ جَعْفَرٍ، - قَالَ ابْنُ أَيُّوبَ حَدَّثَنَا إِسْمَاعِيلُ، - قَالَ أَخْبَرَنِي الْعَلاَءُ، عَنْ أَبِيهِ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏لاَ يَدْخُلُ الْجَنَّةَ مَنْ لاَ يَأْمَنُ جَارُهُ بَوَائِقَهُ ‏"
It is narrated on the authority of Abu Huraira that the Messenger of Allah (ﷺ) observed: He will not enter Paradise whose neighbour is not secure from his wrongful conduct.
Sahih Muslim 46 
In-book : Book 1, Hadith 79 
USC-MSA web (English) : Book 1, Hadith 74  (deprecated)
Sahih Muslim

C) Signs of Resurrection
One of the signs of the Hour is to oppress one's neighbor. The Prophet (peace and blessings of Allaah be upon him) said:
حَدَّثَنَا مَخْلَدُ بْنُ مَالِكٍ، قَالَ‏:‏ حَدَّثَنَا عَبْدُ الرَّحْمَنِ بْنُ مَغْرَاءَ، قَالَ‏:‏ حَدَّثَنَا بُرَيْدُ بْنُ عَبْدِ اللهِ، عَنْ أَبِي بُرْدَةَ، عَنْ أَبِي مُوسَى‏:‏ قَالَ رَسُولُ اللهِ صلى الله عليه وسلم‏:‏ لاَ تَقُومُ السَّاعَةُ حَتَّى يَقْتُلَ الرَّجُلُ جَارَهُ وَأَخَاهُ وَأَبَاهُ‏.‏
Abu Musa reported that the Messenger of Allah (ﷺ) said, "The Final Hour will not come until a man kills his neighbour, his brother and his father."
Hasan (Al-Albani)
Al-Adab Al-Mufrad 118 
In-book : Book 6, Hadith 18 
English translation : Book 6, Hadith 118
Al-Adab Al-Mufrad

Exchanging gifts between neighbors

A) Giving a gift even if it is a small amount
In the case of exchanging gifts between neighbors, even if it is a small amount, do not neglect to accept or give it. The Prophet (peace and blessings of Allaah be upon him) said:
حَدَّثَنَا عَاصِمُ بْنُ عَلِيٍّ، حَدَّثَنَا ابْنُ أَبِي ذِئْبٍ، عَنِ الْمَقْبُرِيِّ، ‏{‏عَنْ أَبِيهِ،‏}‏ عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏يَا نِسَاءَ الْمُسْلِمَاتِ لاَ تَحْقِرَنَّ جَارَةٌ لِجَارَتِهَا، وَلَوْ فِرْسِنَ شَاةٍ ‏"
Narrated Abu Huraira: The Prophet (ﷺ) said, "O Muslim women! None of you should look down upon the gift sent by her female neighbor even if it were the trotters of the sheep (fleshless part of legs).
Sahih al-Bukhari 2566 
In-book : Book 51, Hadith 1 
USC-MSA web (English) : Vol. 3, Book 47, Hadith 740  (deprecated)
Sahih Bukhari

The Prophet (peace and blessings of Allaah be upon him) said:
حَدَّثَنَا مُحَمَّدُ بْنُ بَشَّارٍ، حَدَّثَنَا عُثْمَانُ بْنُ عُمَرَ، حَدَّثَنَا أَبُو عَامِرٍ الْخَزَّازُ، عَنْ أَبِي عِمْرَانَ الْجَوْنِيِّ، عَنْ عَبْدِ اللَّهِ بْنِ الصَّامِتِ، عَنْ أَبِي ذَرٍّ، عَنِ النَّبِيِّ ـ صلى الله عليه وسلم ـ قَالَ‏ إِذَا عَمِلْتَ مَرَقَةً فَأَكْثِرْ مَاءَهَا وَاغْتَرِفْ لِجِيرَانِكَ مِنْهَا ‏"
It was narrated from Abu Dharr that the Prophet (ﷺ) said: "When you make broth, add more water and give some to your neighbor."
Sahih (Darussalam)
English : Vol. 4, Book 29, Hadith 3362 
Arabic : Book 29, Hadith 3487
Sunan Ibn Majah

B) Giving gifts to the nearest neighbor
حَدَّثَنَا حَجَّاجٌ، حَدَّثَنَا شُعْبَةُ، ح وَحَدَّثَنِي عَلِيُّ بْنُ عَبْدِ اللَّهِ، حَدَّثَنَا شَبَابَةُ، حَدَّثَنَا شُعْبَةُ، حَدَّثَنَا أَبُو عِمْرَانَ، قَالَ سَمِعْتُ طَلْحَةَ بْنَ عَبْدِ اللَّهِ، عَنْ عَائِشَةَ ـ رضى الله عنها ـ قُلْتُ يَا رَسُولَ اللَّهِ، إِنَّ لِي جَارَيْنِ، فَإِلَى أَيِّهِمَا أُهْدِي قَالَ‏ إِلَى أَقْرَبِهِمَا مِنْكِ بَابًا ‏"
Narrated Aisha: I said, "O Allah's Messenger (ﷺ)! I have two neighbors and would like to know to which of them I should give presents." He replied, "To the one whose door is nearer to you."
Sahih al-Bukhari 2259 
In-book : Book 36, Hadith 3 
USC-MSA web (English) : Vol. 3, Book 35, Hadith 460  (deprecated)
Sahih Bukhari

Closing
In the light of the Holy Quran and Hadith, we realize that we have some responsibilities towards our neighbors. And a true Muslim can never neglect his responsibilities. So we should always try to be kind to our neighbors. May Allah Almighty grant us the ability to fulfill our responsibilities.