Sheikh Al Islam Ibn Taymiyyah:

Charity is better, except if there is in a gift, a meaning by which it becomes better than charity. For example, gifting the Messenger صلى الله عليه وسلم during his lifetime, out of love for him or gifting a relative with that which connects the ties of kinship or gifting a brother for the sake of Allaah; so this may be better than charity.

Majmoo’ Al Fataawa: 31/ 269