We can verify that \begin{align*} f(z) = -i\frac{z - 1}{z + 1} \end{align*} maps the unit disk to the upper half plane by the following method. First compute the inverse, \begin{align*} z = \frac{1+iw}{1-iw}, \end{align*} then we check the output of this function, does it map the upper half plane to the unit disk? We can show this by noting $w=a+ib = a$, since the imaginary part of $w$ must be zero. It follows that \begin{align*} z = \frac{1+ia}{1-ia} = \frac{1+ia}{1-ia}\frac{1+ia}{1+ia} = \frac{(1+ia)^2}{1+a^2} = \frac{1-a^2 + 2ai}{1+a^2} \end{align*} We conclude that $z=u+iv$ has \begin{align*} u = 1-\frac{2a^2}{1+a^2} \Rightarrow \frac{2a^2}{1+a^2} = 1-u, \quad v = \frac{2a}{1+a^2}, \end{align*} from which follows \begin{align*} v^2 + u^2 = 1, \end{align*} as desired.
Now applying the same method to \begin{align*} f(z) = \frac{z-i}{z+i} \end{align*} I run into problems, since I can no longer just compute the inverse, in this case \begin{align*} z = i\frac{1+w}{1-w}, \end{align*} and set $w=a$ (since $z$ is completely imaginary). To see why, simply fill it in: \begin{align*} z = i\frac{1+w}{1-w} = i\frac{1+a}{1-a} = u+iv, \end{align*} From this it follows that $u=0$ and $v=(1+a)(1-a)$, but no equation for a unit disk follows from it.
What's going wrong and how can I apply the same or a similar method to obtain the required result?
In the first part of your question, you check that the real line is mapped by the inverse to the unit circle, that's why you are taking $w=a$. It's not that it has to be, you set it like that because you want to see where the real line is mapped.
Now, in the second part, the transformation you give maps the unit circle in the left half plane (multiplying by $-i$ rotates clockwise by $90$ degrees). So now, you want to check that, under the inverse, the imaginary axis (i.e. $w=ib$) is mapped to the unit circle.
So you can apply the same method, you just need to be careful what region the map transforms the unit circle into.