If it's dead for years it should be no problem.
The "toxins" inside are mainly essential oils in the resin and they evaporate over time. These vapors could harm insects in a tiny enclosure and that seems to be the main problem; they won't eat it if there is still harmful resin inside

.