Here is a simple counter-example, which uses a similar idea as in Andreas' answer.

Let $N$ be the structure consisting of the binary tree $2^{\lt\omega}$ together with its branches $2^\omega$, with the *initial-segment* relation and the *same-level* relation. (One could replace $N$ with saturated elementary extensions if this feature was really desired.) Let $M$ be any countable elementary substructure of $N$. Let $f_a(x)=y$, if $y\lt a$ and $x$ is on the same level as $x$. This function is uniformly definable, and the domain consists of the finite sequences shorter than $a$. We may place the discrete topology on the points, although other topologies will also work here.

Now select any branch $d$ in $N$ but not in $M$, and consider $f_d$. This function picks out the nodes below $d$, and is therefore not definable in the substructure $M$, but it is definable in $N$ from $d$.  Meanwhile, given any finitely many finite nodes, there is a branch $b$ in $M$ that agrees with $d$ that far, and so $f_d$ is approximated by $f_b$ on that finite set.