Ruling on Using Trees from a Muslim Graveyard
Source: "Ahkam-o-Masail in the Light of the Qur’an and Hadith", Volume 02
Thus:
✔ Using the tree from a graveyard for another waqf purpose—such as in a mosque—is permissible.
✘ Using it for personal benefit, however, is not permissible.
والله أعلم بالصواب
(Maulana Abdul Salam Bastawi, Ahl-e-Hadith Delhi, Vol. 9, Issue 1)
For further details, refer to the books of Hadith under the chapter: باب الأوقاف.

❖ Question
Can a tree from a Muslim graveyard be used for mosque-related purposes or for personal use?✔ Answer
A graveyard is considered waqf (endowed) property, just as a mosque is also waqf.Thus:
✔ Using the tree from a graveyard for another waqf purpose—such as in a mosque—is permissible.
✘ Using it for personal benefit, however, is not permissible.
والله أعلم بالصواب
(Maulana Abdul Salam Bastawi, Ahl-e-Hadith Delhi, Vol. 9, Issue 1)
❖ Explanation:
The mutawalli (caretaker) of the graveyard may use it for personal purposes or give it as a gift to relatives and friends. This is similar to the caretaker of a waqf orchard, who is permitted to eat from its produce and offer it to others.For further details, refer to the books of Hadith under the chapter: باب الأوقاف.