You are asking about a very nice feature of holomorphic functions. If $\Omega \subseteq \mathbb{C}$ is an open subset and $f \colon \Omega \rightarrow \mathbb{C}$ is a holomorphic function then, given any point $z_0 \in \Omega$, the power series expansion of $f$ around $z = z_0$ converges to $f$ on any open disc $B(z_0, R)$ such that $B(z_0, R) \subseteq \Omega$. That is, the power series expansion of $f$ around $z = z_0$ is guaranteed to converge at least on the maximal open disc around $z_0$ that is contained in $\Omega$. You can find a proof in any textbook on complex analysis.
This is indeed somewhat surprising - the power series of $z = z_0$ is calculated using only local information (the derivatives $f^{k}(z_0)$ depend on the values of $f$ in an arbitrary small neighborhood of $z = z_0$) and yet the behavior of the power series depends on "how far" the function $f$ can be extended while remaining a well-defined, holomorphic function.
In your case, the natural domain of definition of $f$ is $\Omega = \mathbb{C} \setminus \{ 2\pi k \, | \, k \in \mathbb{Z} \}$. This guarantees that the power series expansion of $f$ around $z_0 = 5$ converges to $f$ on $B(z_0, 2\pi - 5)$. It cannot converge on any larger disk, for if it would, then the power series expansion would provide a holomorphic extension of $f$ across $2\pi$, showing that $z = 2\pi$ is a removable singularity for $f$. However,
$$ \lim_{x \to 2\pi^{-}} f(x) = \lim_{x \to 2\pi^{-}} \frac{x^2}{e^{ix} - 1} = -\infty $$
so $2\pi$ cannot be a removable singularity of $f$.