Here is a more pedantic take (not as long as it seems, most of it is unpacking the definitions).

Let, in general, $X\times_Z Y$ be the fibered product determined by the arrows $\alpha: X\rightarrow Z$ and $\beta: Y\rightarrow Z$. For arrows $f: W\rightarrow X$ and $g:W \rightarrow Y$ let $f\times g$ be the (unique) arrow $W\rightarrow X\times_Z Y$ making the diagram commute. For an arrow $u:W \rightarrow X\times_Z Y$, $p_1\circ u: W \rightarrow X$ and $p_2\circ u: W\rightarrow Y$ are arrows such that $\beta \circ (p_2\circ u)=\alpha \circ (p_1\circ u)$ which gives us a map $\Phi_{X\times_Y Z}$ between arrows $W\rightarrow X\times_Z Y$ and ordered pairs of arrows $(f: W\rightarrow X, g:W \rightarrow Y)$ such that $\beta \circ g =\alpha \circ f$. The existence part of the universal property of fibered products guarantees that this map is surjective. The uniqueness part guarantees that the map $$\Psi_{X\times_Y Z}: \{(f,g)| f:W \rightarrow X, g:W\rightarrow Y \text{ arrows such that } \alpha\circ f= \beta \circ g\} \mapsto f\times g$$ acts as a left inverse on $\Phi_{X\times_Y Z}$ making it injective, so $\Phi_{X\times_Y Z}$ is a bijection with inverse $\Psi_{X\times_Y Z}$.
Now we can get to work.
We are given arrows $\alpha_1: X_1 \rightarrow Y$, $\alpha_2: X_2 \rightarrow Y$ and $\gamma: Y\rightarrow Z$.
From the definitions and universal property of the fibered products, we have, with
$X_1 \times_Y X_2$ defined by $\alpha_1$ and $\alpha_2$
$X_1 \times_Z X_2$ defined by $\gamma \circ \alpha_1$ and $\gamma \circ \alpha_2$
$Y \times_Z Y$ defined by $\gamma$ and $\gamma$


First we prove the commutativity of the diagram

$T\circ U$ and $S\circ (\alpha_1 \circ p_1)$ are arrows $X_1\times_Z X_2 \rightarrow Y\times_Z Y$. We show that $\Phi_{Y\times_Z Y}(T\circ U)=\Phi_{Y\times_Z Y}(S\circ (\alpha_1\circ p_1))$, i.e., $(l_1 \circ (T\circ U ),l_2 \circ (T \circ U))=(l_1 \circ (S\circ (\alpha_1 \circ p_1)),l_2 \circ (S\circ (\alpha_1 \circ p_1))$.
$l_i \circ (T\circ U )=(l_i \circ T)\circ U = (\alpha_i \circ q_i)\circ U=\alpha_i \circ (q_i\circ U)= \alpha_i \circ p_i$.
On the other hand
$l_i \circ (S\circ (\alpha_1 \circ p_1))=(l_i \circ S)\circ (\alpha_1 \circ p_1)=id_Y \circ (\alpha_1 \circ p_1)=\alpha_1 \circ p_1=\alpha_2\circ p_2$. Since $\Phi_{Y\times_Z Y}$ is injective it follows that $T\circ U=S\circ (\alpha_1\circ p_1)$
Now for the universal property.

Let $g: W\rightarrow X_1\times_Z X_2$ and $f: W \rightarrow Y$ be arrows such that $S\circ f = T\circ g$. We look for an $L:W \rightarrow X_1 \times_Y X_2$ making the above diagram commute. Suppose $L$ exists.
Then $p_i\circ L= (q_i\circ U)\circ L=q_i\circ (U\circ L)=q_i\circ g$, so $\Phi_{X_1\times_Y X_2}(L)=(q_1\circ g, q_2\circ g)$, hence $L=\Psi_{X_1\times_Y X_2}(q_1\circ g, q_2\circ g)$. This proves the uniqueness of candidates $L$ and we know what $L$ must be.
Finally, set $L\equiv \Psi_{X_1\times_Y X_2}(q_1\circ g, q_2\circ g)$ which implies $(p_1\circ L,p_2\circ L)=\Phi_{X_1\times_Y X_2}(L)=(q_1\circ g, q_2\circ g)$. We have $q_i\circ (U\circ L)=(q_i\circ U)\circ L=p_i\circ L=q_i\circ g$, ergo $$\Phi_{X_1\times_Z X_2} (U\circ L)=(q_1\circ (U\circ L)), q_2\circ (U\circ L))=(q_1\circ g, q_2\circ g)=\Phi_{X_1\times_Z X_2} (g)$$ and since $\Phi_{X_1\times_Z X_2}$ is injective it follows that $U\circ L=g$. Also, we have that $(\alpha_1\circ p_1)\circ L=\alpha_1\circ (p_1\circ L)=\alpha_1\circ (q_1\circ g)=(\alpha_1\circ q_1)\circ g=(l_1\circ T)\circ g= l_1\circ (T\circ g)=\\l_1\circ(S\circ f)=(l_1\circ S)\circ f=id_Y\circ f= f$
This proves that $L: W\rightarrow X_1\times_Y X_2$ has the desired properties.