Hello Smp123,
Magnesium is just a salt so should not cause any problems.
5htp is a byproduct of L-tryptophan metabolism so should also not cause any problems.
So, yes you can continue to take them, but to be safe maybe a couple of hours before or after the Sof/Dac so they have basically no physical contact/mixing in your gut.