First, you got $2x+y = n_1\pi$. Then you got $2y+x = n_2\pi$. So, solving for $y$ in the first equation gives: $y = n_1\pi - 2x$. Plugging into the second gives:

$2(n_1\pi - 2x)+x = n_2\pi$

$(2n_1 - n_2)\pi = 3x$

Note that the map $\mathbb{Z}^2 \mapsto \mathbb{Z}$ that takes $(n_1,n_2) \mapsto (2n_1-n_2)$ is a surjection, so we can replace $(2n_1-n_2)$ with $n$:

So, $3x = n\pi$ where $n$ is any integer.

$x = \dfrac{n\pi}{3}$, and $\dfrac{\pi}{3} \in \left[\dfrac{\pi}{4},\dfrac{\pi}{2}\right]$

Plugging in: $y = n_1\pi - 2\dfrac{\pi}{3} = \dfrac{(3n_1-2)\pi}{3}$

So, if $y = \dfrac{\pi}{3}$, it too is in the interval. Those are the only values for $x$ and $y$ that work.