Question: A man sent money with me for another man, and that other man owes me a debt. Is it permissible for me to take from the remitted funds what he owes me, or not?
Answer—and Allah grants success: That is not permissible,—because the man to whom the money is remitted does not deserve it nor own it until it reaches his hand; so long as it is in the messenger’s hand, it is the sender’s property, and the messenger is merely his trustee and agent.
—The messenger is a trustee, and the trust must be rendered to both the righteous and the wicked. Allah Most High has said: “Indeed, Allah commands you to render trusts to whom they are due.” [An-Nisāʾ:58].
Source: Min Thimār al-ʿIlm wa al-Ḥikmah vol.2