All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
In principle, it is permissible for a woman to give a gift to a man and vice-versa even if they are non-Mahrams provided that there is no bad intention in doing so, and there is no concern that it would lead to something forbidden.
It is commendable for people to trade gifts, as the Prophet, sallallaahu ‘alayhi wa sallam, said: “Give gifts to each other, so that you love one another.” [Al-Bukhari and al-Bayhaqi]
Therefore, it is permissible for you to give a gift to your brother-in-law as a token of gratitude for the good that he has done for you, as well as showing appreciation and respect, as long as the above restrictions are observed.
Allaah Knows best.