I know this has been discussed before when it comes to mushrooms, but that's because of mushrooms enzymatic pathway that has only one goal, to add PO and HO molecules to the fourth position of whatever tryptamine they come across.
I don't think most dmt plants have only one specific pathway like this, so it may not work. Even if it did, I don't think it would produce dmt.
Mushrooms also have more of the ability to suck up more then just their average nutrients from their enviornment, which is why they are starting to use them in experiments with cleaning up toxic and radioactive spills. As far as I know, other plants don't really do this, so I am unaware if they will even be able to absorb melatonin or serotonin from their environments like that.
Only way to tell is to grow a plant, take a clone from said plant, and grow that clone in the enriched soil. Then do separate extractions on the two plants and see if the enriched soil made a difference. However that will probably takes years to complete and I doubt you want to wait that long.