I believe I have found one answer: it suffices that the two spaces be pseudo-metrizable. That's the only requirement on them we need. We can also dispense with the requirement that $f$ be continuous; that ensures that $f(x)=g(x)$ for $x\in D$, but is not needed to simply prove that $g$ is continuous.
Statement of theorem: Let $(X_i,\tau_i)$ be pseudo-metrizable topological spaces for $i=1,2$; let $D$ be a dense subset of $X_1$; and let a sequential limit of $f(d)$ as $d\to x$ exist for all $x\in X_1$. Then the function $g\colon X_1\to X_2$, defined such that $g(x)$ is a sequential limit of $f(d)$ as $d\to x$, is continuous.
Proof: Since $(X_i, \tau_i)$ is pseudo-metrizable, continuity is the same as sequential continuity, and convergence is the same as sequential convergence on $X_i$. The same holds for the sub-topology of $X_1$ induced by $D$.
Now consider a sequence $(x_i)$ in $X_1\setminus\{x_0\}$ that converges to a value $x_0$.
- Define $y_n=g(x_n)$ for $n>0$.
- Let $V_n$ be the open ball in $X_2$ of radius $1/n$ centered at $y_n$.
- Let $W_n$ be the open ball in $X_1$ of radius $1/n$ centered at $x_n$.
- Let $U_n$ be some open neighborhood of $x_n$ such that $f(U_n\cap D)\subseteq V_n$; the definition of $g(x_n)$ as a sequential limit, and the fact that sequential limits and topological limits are the same for a pseudo-metrizable space, guarantee that this exists.
- Let $d_n$ be any element of $W_n\cap U_n\cap D$. This set is nonempty because $W_n$ and $U_n$ are both open sets containing $x_n$, hence $W_n\cap U_n$ is an open set containing $x_n$ (and hence is nonempty), hence $W_n\cap U_n\cap D\neq\emptyset$ by the density of $D$.
- Let $z_n = f(d_n)$.
- Let $\mu_i$ be a pseudo-metric on $X_i$ that induces the topology $\tau_i$.
Since $(x_i)\to x$ and $\mu_1(x_n,d_n)\to 0$ as $n\to\infty$, we have $(d_i)\to x$.
Since $(d_i)\to x$ and $g(x)$ is a sequential limit of $f(d)$ as $d\to x$, we have $(z_i)\to g(x)$. But $\mu_2(y_n, z_n)\to 0$ as $n\to\infty$, so $(y_i)\to g(x)$ also.
This holds for any sequence $(x_i)$ in $X_1$ that converges to $x_0$, hence $g$ is sequentially continuous, which implies it is continuous.