The Messenger of Allah ﷺ said, "Whoever catches one rakah of the morning prayer before the sun rises has caught it, and whoever catches one rakah of the afternoon prayer before the sun sets has caught it."Jamil bin al-Hasan narrated to us, Abdul-Ala narrated to us, Muamar narrated to us, from Zuhri, from Abu Salama, from Abu Hurairah, that the Messenger of Allah ﷺ said something similar.
حدثنا أحمد بن عمرو بن السرح وحرملة بن يحيى المصريان قالا حدثنا عبد الله بن وهب قال أخبرني يونس عن ابن شهاب عن عروة
أن رسول الله ﷺ قال من أدرك من الصبح ركعة قبل أن تطلع الشمس فقد أدركها ومن أدرك من العصر ركعة قبل أن تغرب الشمس فقد أدركها حدثنا جميل بن الحسن حدثنا عبد الأعلى حدثنا معمر عن الزهري عن أبي سلمة عن أبي هريرة أن رسول الله ﷺ قال فذكر نحوه
Muslim included it in "the Book of Mosques, the chapter on whoever catches up with a rakat of the prayer has caught up with that prayer," hadith no. 609, through the hadith of Yunus bin Yazid, with the same chain.