In a song called [イノコリ先生] I found a phrase in the lyric which I could not translate into a good understandable meaning from its individual meanings by myself. [友達とは違う関係] . If I try to roughly translate it by myself, it would be [with friend is a relationship that differs]?! And it doesn't make any sense.
It means our relationship is different than friends.
It's a bit hard to explain, but ... と is used to compare 2 things. "friend" is 1 of the things we are trying to compare, the other one is implied to be "what is between us", then 違う関係 means a different relationship. So basically it's like saying "friend" is not be the correct "relationship" to be "compared" with "what we have". If that make any sense.
The biggest issue I see in your translation is using "with" for "と". You need to separate a modifying phrase 友達とは違う and a modified noun 関係.
関係 means relationship.
違う means to differ (from).
The above phrase translates to relationship that differs (literally) and different relationship. You may ask differ from what? The answer is
友達とは違う means to differ from a friend.
If you combine all three of them, the literal translation would be a relationship that differs from a friend. It could mean an ambiguous relationship between a friend and lover, for example. You think your relationship is no longer friendship because you've done something that friends don't usually do. That's one of the contexts where you can use the phrase.