Only as long as
$$d = \gcd(p,q) \mid N - m - n \tag{1}\label{eq1A}$$
then there's a way to solve the system of congruences. You have
$$x \equiv m \pmod{p} \iff x - m = ap, \; a \in \mathbb{Z} \tag{2}\label{eq2A}$$
$$y \equiv n \pmod{q} \iff y - n = bq, \; b \in \mathbb{Z} \tag{3}\label{eq3A}$$
Adding \eqref{eq2A} and \eqref{eq3A}, plus using that $x + y = N$, gives
$$\begin{equation}\begin{aligned}
x + y - m - n & = ap + bq \\
N - m - n & = ap + bq
\end{aligned}\end{equation}\tag{4}\label{eq4A}$$
Note Bézout's identity states there exists integers $x$ and $y$ such that
$$xp + bq = d \tag{5}\label{eq5A}$$
Multiplying both sides by $\frac{N - m - n}{d}$ allows you to assign $a = \frac{x(N - m - n)}{d}$ and $b = \frac{y(N - m - n)}{d}$. From \eqref{eq2A} you have $x = m + ap$, and from \eqref{eq3A} you have $y = n + bq$. You can confirm this also fits \eqref{eq4A} and that $x + y = N$.