Here is a comparatively concrete counter-example. 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. Let $M$ be any countable elementary substructure of $N$. (One could replace $N$ with a saturated elementary extension, if this feature was really desired.) Consider the function $f_a(x)=y$, if $y\lt a$ and $y$ is on the same level as $x$. That is, we map the part of the tree at levels below $a$ to the path of nodes below $a$. 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.