It is well established that neighbors have a claim to good and kindly treatment. This is encouraged by all religions. It is also universally accepted in all human societies, apart perhaps from some highly materialistic and individualistic ideas. However, it is given more prominence and greater importance under Islam. The Quran makes it clear that neighbors are entitled to such kindness, whether they are related to us or not Worship God alone and do not associate with Him any partners. Be kind to your parents and near of kin, to orphans, the needy, the neighbor who is related to you and the neighbor who is a stranger, the friend by your side, the wayfarer, and those whom your right hands possess. God does not love those who are arrogant and boastful. (4 36)
Time and again, the Prophet (Pbuh) urged his companions and all Muslims in all generations to look after their neighbors and be ready with help whenever help is needed, even by a neighbor whose behavior is far from neighborly. After he became Gods last messenger, he lived in Makkah for 13 years in very hostile surroundings. Some of his neighbors were bent on giving him a hard time, resorting to all sorts of tactics that were bound to offend and harass even the most patient of people. Yet the Prophet never replied with anything other than a good turn. The maximum that he did to express his irritation when neighbors repeatedly threw filth at his doorstep was to say What sort of neighborliness is this
When the Prophet migrated to Madinah, he sought to strengthen ties between his followers. His community was steadily growing in power and numbers. He urged his followers to maintain the best of neighborly relations. He considered kindness to neighbors as a sign of strong faith. Hence, if a person is aware of his neighbors poverty and does not give a helping hand, he is not a believer. He says A person who goes to bed having had a full meal while aware that his next door neighbor is hungry does not believe in me, not even for an hour. A highly authentic Hadith quotes the Prophet as saying Gabriel continued to urge me to be kind to neighbors until I started to think that he would tell me that they have a share of my inheritance. (Related by AlBukhari and Muslim). The Prophet is also quoted as saying Whoever believes in God and in the Day of Judgment must not offend his neighbor.
Needless to say, the closer a neighbor is, the higher is his claim to our kindness. Hazrath Ayesha asked him Messenger of God I have two neighbors whom should I favor with my gifts He said To the one next door to you. (Related by AlBukhari).
Indeed when next door neighbors are in dire need, they may be given precedence over close relatives. The Prophets darling daughter, Fatimah, and her husband, Ali, his own cousin, asked him to give them a servant when some slaves were brought to him. He refused their request because people staying next to the mosque were suffering from hunger. Those poor people were immigrants in Madinah who arrived with nothing and could not easily find work. They stayed close to the mosque, and the Prophet looked after them. They were known as the people of AlSuffah. There numbers varied as some of them found work and moved into a home in Madinah, but newcomers joined them as they arrived to join the Muslim community. When the Prophet received any gift of food, he would eat some of it and send the rest to them. If such a gift was a charity, or sadaqah, he would send it all to them because, as a prophet, charity was not lawful for him or his household to take.
Abu Hurayrah was one of the people of AlSuffah and he relates the following story By God, other than whom there is no deity, I might at times be so hungry that I would lie with my abdomen to the floor, or I would tie up a stone on my belly to relieve the pangs of hunger. One day, I sat by the roadside, where people would pass by me. The Prophet passed by and smiled as he saw me. From my looks, he realised what I was feeling. He called me and I said At your service, Messenger of God He told me to follow him and went along. I followed him until he went inside his home, and then admitted me. He saw some milk in a cup. He asked where did that milk come from. He was told that it was a gift sent by a certain person. He said to me Go to the people of AlSuffah and invite them to come.
Those people of AlSuffah were the guests of Islam. They had no families, no money and no one to care for them. When the Prophet received anything in charity, he would send it to them, without taking any part of it. If he received a gift, he sent for them, partook of it and gave the rest to them.
When on this occasion he told me to call the people of AlSuffah, I was displeased. I thought How far will such little amount of milk go among the people of AlSuffah I could have had a proper drink of milk to regain my strength. Now when they come, I will have to serve them. What will remain for me of this small cup of milk Yet there was nothing for me but to obey God and His messenger. I went to them and called them. They came in, and he admitted them. They sat down in his home. The Prophet said to me Take this milk and give it to them to drink. I took up the cup and gave it to the next man. He drank his fill and gave it back to me. I would then give it to the next man, and this was repeated time after time until they all had had their fill. I then went up to the Prophet. He took up the cup, put it on his hand, looked at me and smiled. He then said to me Abu Hurayrah Only you and I are left. I said That is right, Messenger of God He said Sit down and drink I did so. He then said Drink. I did. He continued to tell me to drink until I said By Him who sent you with the message of truth, I can drink no more. He said Let me have a look. I gave him the cup. He praised God, said, Bismillah (which means in Gods name) and drank the remainder. (Related by AlBukahri).
This is just one of the many occasions when the Prophet shared out very little food or drink among a large number of people. God blessed that food and drink for him and it sufficed by Gods will.

