I see that Michael Greinecker has preempted the idea on which I was working; I post this only because it contains a little more detail about the retopologizing, since I didn’t know the general lemma that Michael quotes and had to make my own way at that point.
Let $\mathscr{N}=\omega^\omega$ with the product topology $\tau$. Let $d$ be any complete metric on $\omega^\omega$ that generates $\tau$ and is bounded by $1$. Let $F$ be a closed subset of $\mathscr{N}$, and define a new metric $\rho$ on $\omega^\omega$ as follows:
$$\rho(x,y)=\begin{cases}
d(x,y),&\text{if }x,y\in F\text{ or }x,y\in\mathscr{N}\setminus F\\
2,&\text{otherwise}\;.
\end{cases}$$
It’s easy to check that $\rho$ is a metric. Let $\tau_\rho$ be the topology on $\omega^\omega$ generated by $\rho$, and let $X$ be $\omega^\omega$ with the topology $\tau_\rho$. Clearly $F$ is clopen in $X$. Any $\rho$-Cauchy sequence must be eventually in $F$ or in $X\setminus F$ and must therefore be $d$-Cauchy, so $\langle X,\rho\rangle$ is complete. Moreover, $\tau_\rho$ is just the join of $\tau$ and $\{\varnothing,F,\mathscr{N}\setminus F,\mathscr{N}\}$, so it’s second countable, and $X$ is therefore a Polish space in which $F$ is a clopen set.
Now let $A\subseteq\mathscr{N}$ be analytic but not Borel. Because $A$ is analytic, there is a closed $H\subseteq\mathscr{N}\times\mathscr{N}$ such that $A=\pi_0[H]$, where $\pi_0:\mathscr{N}\times\mathscr{N}\to\mathscr{N}:\langle x,y\rangle\mapsto x$. Let $h:\mathscr{N}\to\mathscr{N}\times\mathscr{N}$ be a surjective homeomorphism, and let $F=h^{-1}[H]$. Apply the construction of the first paragraph to this $F$. Then $f\triangleq\pi_0\circ h:X\to\mathscr{N}$ is continuous, and $f[F]=A$, so $A$ is a non-Borel image of the clopen set $F$ in the Polish space $X$.