Sayyiduna Abu Hurayrah (may Allah be pleased with him) narrates: the Prophet (peace and blessings be upon him) said: "The right of neighbourliness extends to forty houses, this way, and this way, and this way, and this way (perhaps the following words are the narrator's:), that is, to the right, to the left, in front and behind."
Abu Ya'la recorded it from his teacher Muhammad bin Jami' al-Attar, and he is da'if (weak). The hadith narrated by Sayyiduna Ka'b bin Malik (may Allah be pleased with him) is in the chapter on harming the neighbour.