Let $f$ be a positive definite binary quadratic form with integer coefficients. Define
$$\displaystyle S_f = \{n \in \mathbb{N} : \exists (x,y) \in \mathbb{Z}^2 \text{ s.t. } f(x,y) = n^2\}.$$
Clearly, if $g$ is $\operatorname{GL}_2(\mathbb{Z})$-equivalent to $f$, then $S_f = S_g$. Is the converse true? That is, if $S_f = S_g$ and $f,g$ have the same discriminant, does it imply that $f$ and $g$ are $\operatorname{GL}_2(\mathbb{Z})$-equivalent?