As pointed out in the comments, this is false: $\sin(x)$ has infinitely many zeroes, so it coincides with the constant function $0$ infinitely often.
What is true, however, is that if $U$ is a connected domain, $f,g$ are analytic in $U$, and the set of points where $f$ and $g$ coincide has a limit point in $U$, then $f=g$.
In particular, if the set of points where $f$ and $g$ agree is uncountable, then $f=g$. This is because ${\mathbb C}$ is second countable: There are countably many open sets such that any open set is the union of some of them, namely the balls with rational radius and center with rational coordinates. It easily follows from this that any uncountable subset of $U$ must have a limit point in $U$. To see this, note that it follows that some ball $B$ whose closure is completely contained in $U$ contains uncountably many of these points where $f$ and $g$ coincide. This set has a limit point, that belongs to the closure of $B$ and therefore to $U$.
To prove the result, note it suffices to assume that $g=0$, and prove that $f=0$ (replace $f,g$ with $f-g,0$). The argument goes by showing that the set $L$ of points $t\in U$ that are limit points of those $z\in U$ such that $f(z)=0$ is open in $U$. This set is clearly closed by continuity of $f$, and it is non-empty by assumption. Since $U$ is connected, it follows that this set coincides with $U$.
To prove that $L$ is open, use that analytic functions can be represented by power series is (small) neighborhoods about any point of their domain. Let $t_0\in L$. Then for $z$ sufficiently close to $t_0$, $ f(z)=\sum_{n=0}^\infty \alpha_n(z-t_0)^n$ for some constants $\alpha_0,\alpha_1,\dots$. It suffices to show that $\alpha_n=0$ for all $n$. Otherwise, there is a least $k$ such that $\alpha_k\ne0$. Note $k>0$ since $t_0\in L$. By factoring $(z-t_0)^k$ in the expansion of $f$, we can write $ f(z)=(z-t_0)^k h(z) $ for some $h$ analytic in a small neighborhood of $t_0$ and such that $h(t_0)\ne0$. But then, by continuity, $h(z)\ne0$ if $z$ is sufficiently close to $t_0$. It follows that $f(z)\ne0$ for $z\ne t_0$, $z$ sufficiently close to $t_0$. But this contradicts that $t_0$ is a limit point of those $z$ where $f(z)=0$.