The other answers are fine. However, to my taste, there is a more conceptual explanation involving covering space theory.
In summary, the above relationship between inverse tangent and complex logarithm holds since the tangent function and exponential function are "essentially the same" universal topological covering map. In even more informal terms, the exponential map and the tangent are (up to isomorphism) both a solution to the same optimization problem (if one views a universal cover, or more generally a universal object, as a solution to an optimization problem, as done here).
Let me explain. Firstly, both the exponential function $$\operatorname{exp}\colon \mathbb{C}\rightarrow\mathbb{C}\setminus\{0\}$$
and the tangent function
$$\operatorname{tan}\colon \mathbb{C}\rightarrow \mathbb{P}^1\setminus\{\pm i\}$$
are universal covers. Here, $\mathbb{P}^1$ denotes the Riemann sphere.
Now, take a homeomorphism $f\colon \mathbb{C}\setminus\{0\}\rightarrow \mathbb{P}^1\setminus\{\pm i\}$. As an example, consider the following (restricted) Möbius transformation
$$f(z):=-i\cdot\frac{z-1}{z+1}.$$
This map is induced from the unique autmorphism
$\hat{f}$ of the Riemann sphere with $\hat{f}(0)=i, \hat{f}(\infty)=-i$ and $\hat{f}(1)=0.$ Its inverse is given by
$$f^{-1}(z)=\frac{i-z}{i+z}.$$
Next, consider the following diagram of covering maps
$$\require{AMScd} \begin{CD} \mathbb{C} @.\mathbb{C}\\ @V\operatorname{exp} VV @VV\operatorname{tan}V\\ \mathbb{C}\setminus\{0\}@>>f> \mathbb{P}^1\setminus\{\pm i\} \end{CD}$$
Since $\operatorname{exp}\colon \mathbb{C}\rightarrow \mathbb{C}\setminus\{0\}$ is a universal cover and $f$ is a biholomorphism (in particular a homeomorphism), the composition $f\circ \operatorname{exp}\colon \mathbb{C}\rightarrow \mathbb{P}^1\setminus\{\pm i\}$ is a universal cover.
Furthermore, we have $f(\operatorname{exp}(0))=0=\operatorname{tan}(0)$.
In other words, the covering maps $f\circ\operatorname{exp}\colon (\mathbb{C},0)\rightarrow (\mathbb{P}^1\setminus\{\pm i\},0)$ and $\operatorname{tan}\colon (\mathbb{C},0)\rightarrow (\mathbb{P}^1\setminus\{\pm i\},0)$ are both initial objects in the category of (pointed) coverings of the pointed topological space $(\mathbb{P}^1\setminus\{\pm i\},0)$. The objects of this category are covering maps $p\colon(X,x)\rightarrow (\mathbb{P}^1\setminus\{\pm i\},0)$ with $p(x)=0$. Here, $(X,x)$ is any topological space $X$ with base point $x$. The morphisms are fiber-preserving continuous maps between coverings of $(\mathbb{P}^1\setminus\{\pm i\},0)$ that preserve the base point.
Now, initial objects are unique up to unique isomorphism. Said differently, there exists a unique homeomorphism $g\colon \mathbb{C}\rightarrow \mathbb{C}$ with $g(0)=0$ such that the following diagram commutes
$$\require{AMScd} \begin{CD} \mathbb{C} @>g>>\mathbb{C}\\ @V\operatorname{exp} VV @VV\operatorname{tan}V\\ \mathbb{C}\setminus\{0\}@>>f> \mathbb{P}^1\setminus\{\pm i\} \end{CD}$$
This mapping reads as $g(z)=\frac{1}{2i}z$. It should not come as a suprise that $g$ has to be an automorphism of the complex plane (and hence of the form $g(z)=az$ with $a\in \mathbb{C}\setminus\{0\}$): A lift of a holomorphic mapping between Riemann surfaces along a unbranched holomorphic covering map is necessarily holomorphic (see Theorem 4.9 in Forster's Lectures on Riemann surfaces).
Anyways, by reversing arrows (and choosing branches of complex logarithm and tangent) we obtain the formula given in Michael Hardy's answer
$$\operatorname{arctan}(z)=(g\circ \operatorname{log}\circ f^{-1})(z)=\frac{1}{2i}\operatorname{log}\big(\frac{i-z}{i+z}\big).$$