It turns out the answer is positive. Take for instance $\mathbb{R}^n$ with the Euclidean metric $d$. Let $\tilde d$ be any other metric on $\mathbb{R}^n$ satisfying $\text{Iso}(\mathbb{R}^n,d)=\text{Iso}(\mathbb{R}^n,\tilde d)$. We will show $\tilde d(x,y)$ depends only on $d(x,y)$.
Let $c \in \mathbb{R}^{> 0}$, and consider any two pairs of points of distance $c$ of each other, i.e:
$a,b,\tilde a,\tilde b \in \mathbb{R}^n$ such that $d(a,b)=d(\tilde a,\tilde b)=c$. Then there exists an isometry $\phi$ of $(\mathbb{R}^n,d)$ such that $\phi(a)=\tilde a,\phi(b)=\tilde b$. (First translate by $\tilde a -a$ and then compose with a suitable orthogonal linear map).
By our assumption, $\phi$ is also an isometry of $(\mathbb{R}^n,\tilde d)$, so: $\tilde d(a,b)=\tilde d(\tilde a,\tilde b):=f(c)$
Thus, $\tilde d(x,y)$ indeed depends only on $d(x,y)$, as required.
This proofs works for any metric space whose isometry group is 2-transitive, i.e it acts transitively on pairs of points with identical distances. In particular, it works for the round sphere, and for any finite dimensional normed space whose isometry group acts transitively on the unit sphere. (It is known that any such normed space is in fact an inner product space*, so this is essentially just the case of Euclidean $\mathbb{R}^n$ again)
I wonder if 2-transitivity of $\text{Iso}(X,d)$ is necessary for determining the metric in such a way. I suspect it's not.
*This follows essentially because Isometry group of a norm is always contained in some Isometry group of an inner product. For details , see here.