two words that can be interchanged in a context are said to be synonymous relative to that context
"The teacher explained that while "happy" and "joyful" are synonyms, they aren't always interchangeable because the tone of the poem requires one over the other."
A word whose meaning is the same as that of another word.
"When I was stuck for a description, my editor suggested finding a synonym for "happy" to make the story more vivid."
The word "synonym" comes from the Ancient Greek sunōnymon, which literally means "having the same name." It entered English via Middle English and Latin, combining elements that signify being together with a name.