The answer is *yes* under the assumption that *the general element of the mobile part of the family is irreducible*, and a proof goes at follows.

Write your analytic family of curves as $$\{X_t\} = Z + \{M_t\},$$
where $Z$ is the fixed part (i.e., the maximal effective divisor contained in any member of the family) and $\{M_t\}$ is a $2$-dimensional analytic family with at most isolated base points (the mobile part).

Then, calling $M$ the cohomology class of $M_t$, which is by definition independent on $t$, we claim that $M^2 >0$. In fact, given any irreducible $M_t$ and a general point $p$ on it, our assumption on the dimension implies that we can find an irreducible $M_s$, with $s \neq t$, such that $p \in M_s$, hence $p \in M_t \cap M_s$ and this proves our claim.

Now we are done, since a smooth, compact, complex surface is projective if and only if there exists on it a divisor with strictly positive self-intersection, see Barth-Peters-Van de Ven, *Compact Complex Surfaces*, Chapter 4, Theorem 5.2.

**Remark.** If the general element of the mobile part $\{M_t\}$ is not irreducible, the result is in general false. For instance, take a surface $S$ with algebraic dimension $1$, and consider the fibration $f \colon S \to \mathbb{P}^1$ given by the essentially unique meromorphic function on $S$ (if necessary, blow-up some point on $S$ in order to make it a holomorphic map). Writing $F_{u}$ for the fibre over $u \in \mathbb{P}^1$, the linear system $|F_0 + F_{\infty}|$ provides a $2$-dimensional family of curves on $S$, whose members are all disjoint unions of two fibres.

1more comment