This is forbidden in Islam according to the Prophet, as he has said that Jews and Christians, who built their temples atop graves, proceeded to pray in them. But this is forbidden, as is writing on graves, since this is a form of association/polytheism since it may be written "a comrade of God." But if it is written on the stone "person X, the son of person Y" is permitted.