The Messenger of Allah ﷺ said, "Charity should come from a surplus of wealth. Begin with those whom you support, and the upper hand is better than the lower hand."
حدثنا أبو أحمد حدثنا معقل يعني ابن عبيد الله عن عطاء
قال رسول الله ﷺ الصدقة عن ظهر غنى وابدأ بمن تعول واليد العليا خير من اليد السفلى
Its isnad is sahih. It previously appeared at 7727. Maqil bin Ubaydullah is truthful but makes mistakes, though he did not make a mistake here, and Muslim narrated from him.With this exact wording, Ibn Khuzayma narrated it, 4/97, no. 2441, in the chapter on zakat, on the merit of charity.With similar wording, Bukhari narrated it, 2/139, in the chapter on zakat, on the fact that there is no charity except from surplus wealth, and Muslim, 2/717, no. 1033, in the chapter on zakat, on the explanation that the upper hand is better, and Abu Dawud, 2/122, no. 1648, and Tirmidhi, 4/573, no. 2343, who said it is hasan sahih, and Nasai, 5/61, no. 2533.