If there is money left over from a waqf, it may be donated to another, similar waqf
Question

We bought a piece of land to build a mosque, but recently we found out that there is a mosque nearby that is sufficient. So we decided to sell this land and build a mosque in another area, but we will make a profit when we sell the land. Can we give this profit only to our brother who is poor, and his family, as they are in urgent need of financial support?
Praise be to Allah.If the land was set aside as a waqf (endowment) to build a mosque, or it was bought with money that was given as a waqf for the purpose of building a mosque, then if there is no need for it because there is already a mosque nearby, the land should be sold and the price should be donated to another mosque. If the money has increased and there is no other mosque to which the money can be donated – which is unlikely – then the money may be donated in the public interest and to the poor.
But if the land was not set aside as a waqf for a mosque, and there is no money that was set aside as a waqf to  build a mosque – rather it is general charity, for example – then it is permissible to give some of the price received for the land to your poor brother and his family.
The basic principle regarding that is that wealth that has been set aside as a waqf should only be spent on the purpose for which it was set aside. If it is not possible to make use of it in that cause, or there is no need for it, then it should be spent on a similar cause.
Shaykh Ibn Baz (may Allah have mercy on him) was asked: There is a mosque in the USA for which money was collected and it was built, and a lot of money is left over. In another region there is a mosque, around which there is a large Muslim community, and they want to build a library, school and some other facilities, and some of those who are in charge of the project want to take some of the money that is held by those who are in charge of the first mosque, but the people in charge of the first mosque are refusing on the grounds that the money is only for the first mosque, and they say: If Shaykh ‘Abd al-‘Aziz ibn Baz issues a fatwa allowing transfer of the funds from that mosque to this one, then we have no objection to that. We hope that you can advise us about that.
He replied: If the first mosque for which money was collected has been completed and does not need the money, then the surplus money should be given to build other mosques and things that may be added to them such as libraries, washrooms and the like, as the scholars have stated in the books on awqaf (endowments). Moreover, such projects are akin to the mosque for which the funds were donated, and it is well known that the donors intended to help in building one of the houses of Allah, so whatever is left over may be given to a similar project. If there is no mosque that needs the surplus funds, they may be spent on other public causes for the sake of Allah and which serve the Muslims, such as schools, and they may be given in charity to the poor and the like. And Allah is the source of help."(Fatawa ash-Shaykh Ibn Baz  20/14).
And Allah knows best.