I believe the claim is false in general. The residues at $s=1$ do not match. Indeed, let us consider the simplest case where $P=p$ is prime and $\equiv 1 \mod 4$. It is easy to see that $\mathcal O_K^\times=\{\pm 1\}$, where $K=\mathbb Q(\sqrt{-p})$. The claimed equality is then
$$\sum\frac{1}{m^2+pn^2} = L_1(s) L_{-4p}(s) + L_p(s)L_{-4}(s).$$
We have $L_1(s) L_{-4p}(s) = \zeta(s)L(\theta_K, s) = \zeta_K(s)$, where $\theta_K$ is the quadratic character of conductor $4p$ attached to $K$, and $\zeta_K$ is the Dedekind zeta function. The term $ L_p(s)L_{-4}(s)$ is holomorphic at $s=1$, so it contributes nothing to the residue. Moreover, the sum
$$\frac{1}{2}\sum\frac{1}{m^2+pn^2} := L(\mathfrak c_0, s)$$
can be identified with the sum of $\|I\|^{-s}$, for $I$ running over the principal ideals of $K$ (i.e. the elements of the trivial ideal class $\mathfrak c_0$). (I divided by two because $\mathcal O_K^\times=\{\pm 1\}$.) A classical result states that the ideals are uniformly distributed among the ideal classes, i.e. that $\text{res}_{s=1} L(\mathfrak c, s) = \kappa/h$, where $h = |\text{Cl}(\mathcal O_K)|$, $\kappa = \text{res}_{s=1} \zeta_K(s)$, and $\mathfrak c$ is any ideal class. Comparing the residues on both sides yields
$$2\kappa/h = \kappa \Rightarrow h=2$$
which implies that the residues coincide only if $h=2$. So the formula is false as soon as $\mathbb Q(\sqrt{-p})$ has class number $\neq 2$.
Remark: this doesn't disprove the case $p=5$ that you checked, because in this case $h=2$.
Second remark: It is possible to "single out" the principal ideals, by using the character group of the ideal class group. Let $G$ be the character group of $\text{Cl}(\mathcal O_K)$. Given an element $\eta\in G$, we define the $L$-function
$$L(\eta, s) = \sum_{I\subseteq O_K}\frac{\eta([I])}{\|I\|^s},$$
where $[I]$ denotes the ideal class of $I$. Then, by the usual orthogonality relations for characters, for any ideal class $\mathfrak c$ we have
$$L(\mathfrak c, s) = \frac{1}{h}\sum_{\eta \in G}\eta(\mathfrak c)^{-1}L(\eta, s).$$
In particular, if $|\mathcal O_K^\times| = w < \infty$, we have the nice formula
$$\sum_{\alpha \in \mathcal O_k}N(\alpha)^{-s} = \frac{w}{s} \sum_{\eta \in G}L(\eta, s).$$