There is more to be said in the case of $\pi_*$. Of course we assume all the spaces are connected and pointed. Let $Z= X \cup_f Y$. Then we have a triad $(Z:Y,X)$ whose homotopy groups were first studied by Blakers and Massey, see this ncatlab reference.
There is also some more information which can be obtained using the techniques given in the EMS Tract vol 15 (2011) partially titled Nonabelian Algebraic Topology (NAT) (pdf available). Thus we can consider the homotopical excision morphism $$\varepsilon_n: \pi_n(X,A) \to \pi_n(Z,Y).$$ Note that there is a morphism $\lambda: \pi_1(A) \to \pi_1(Y)$ induced by $f: A \to Y$, and the displayed groups are modules over these fundamental groups if $n >2$, and
crossed modules if $n=2$. Suppose the pair $(X,A)$ is $(n-1)$-connected. Then $(Z,Y)$ is $(n-1)$-connected and $$\pi_n(Z,Y) \cong \lambda_*(\pi_n(X,A)),$$
the "induced" module if $n>2$ and induced crossed module if $n=2$. This result is Corollary 5.4.2 of NAT if $n=2$ and Theorem 8.3.9 of NAT if $n>2$. Notice that if $n=2$ this is a nonabelian result: NAT contains a number of calculations using this result, which generalises a Theorem of J.H.C. Whitehead on free crossed modules in his paper "Combinatorial Homotopy II", a Theorem which is sometimes stated, but rarely proved, in texts on algebraic topology. These results generalise the Relative Hurewicz Theorem and are Corollaries of a Higher Homotopy Seifert-van Kampen Theorem (HHSvKT).
Indeed, as stated in the ncatlab reference, the algebraic form of the Blakers-Massey Theorem, not just the connectivity part, is also a consequence of a more general HHSvKT, see this exposition.
Some expository presentations are available on my preprint page.