Is it right that you wanted to say 'these words came from my heart'?
Ofcourse '마음속에서 우러나온 말이다' is better sentence, but it's translated little libreally.
So i also recommend you to use
'마음속에서 나왔던 말이다'.
It's closer to literal translation.
My previous english teacher also taught me to use basic sentence at first. So it would be better to know both sentence :)