The Messenger of Allah ﷺ came in to me while I was in one of the gardens of Banu Najjar, in which there were graves of some of them who had died in the days of ignorance. He heard them being punished, so he came out saying, "Seek refuge in Allah from the punishment of the grave."I said, "Messenger of Allah, are they truly being punished in their graves?"He replied, "Yes, with a punishment that the beasts can hear."
حدثنا أبو معاوية قال حدثنا الأعمش عن أبي سفيان عن جابر
دخل علي رسول الله ﷺ وأنا في حائط من حوائط بني النجار فيه قبور منهم قد ماتوا في الجاهلية فسمعهم وهم يعذبون فخرج وهو يقول استعيذوا بالله من عذاب القبر قالت قلت يا رسول الله وإنهم ليعذبون في قبورهم قال نعم عذابا تسمعه البهائم
Its isnad is sahih. It was previously mentioned at 18443, and it is found in Muslim 13.