It's likely safe to consume, except that you have no idea how much of the original drug is there, and how much has turned into black goo. I say it's safe because at most there's 40mg of it, and it's hard to imagine what 4-AcO-DMT could possibly turn into that's so nasty that you'd need to worry about eating 40mg of it.
4-sub-tryptamines will start turning to brown/black goo very rapidly if exposed to moisture and air. Like, if you were to weigh out a dose into a vial, then rinse the vial out with water and drink it, by the time the trip is over, if you look at the bits of liquid left in the vial - it's turned brown. Yet the same drug will stay good as new for years stored properly.
Since you had a trivial amount of it stored like that, you should bin it, get some fresh material, and take care to store it in an air-tight container, away from moisture.
Do not trust a baggie as airtight. It's a ziplock bag manufactured for fractions of a fraction of a cent in china, shipped halfway across the world and handled roughly by everyone in between, mashed around in your pocket after you pick it up from your dealer all the way home, and you're trusting it to be airtight and keep your expensive drugs safe?