So, suppose I work in a category where fibred products exist. Let $X_1,X_2, Y$ and $Z$ objects in this category, $f_i:X_i\rightarrow Y$, and $g:Y\rightarrow Z$ be morphisms.
I am trying to show that the following square is Cartesian: $\require{AMScd}$ \begin{CD} X_1\times_Y X_2 @>\psi>> X_1 \times_Z X_2 \\ @Vf_i\circ \pi_i^YVV @VV \phi V \\ Y@>>\Delta> Y\times_Z Y \end{CD} where $\pi_i^Y:X_1\times_Y X_2\rightarrow X_i$ are the projections (whose compositions are equal), $\Delta$ is the diagonal map, $\psi$ is the map induced by the projections $\pi_i^Y$, and $\phi$ is the map induced by the composition $f_i\circ \pi_i^Z$, where $\pi_i^Z:X_1\times_Z X_2\rightarrow X_i$ are the projections.
Now, I have checked that this diagram commutes by showing that $\Delta\circ f_i\circ \pi_i^Y$ and $\phi\circ \psi$ are the unique morphisms induced by $f_i\circ \pi_i^Y$, so they have to be the same.
What I am having trouble showing is that this actually satisfies the universal property. I have found this answer here, but there is one step that I disagree with, and I think it is critical.
Let $T$ be another object, and $\alpha:T\rightarrow Y$, $\beta:T\rightarrow X_1\times_Z X_2$ morphisms such that $\Delta\circ \alpha=\phi\circ \beta$. Now I agree that giving a map of $\beta$ is equivalent to the data of maps $\gamma_i:T\rightarrow X_i$ such $g\circ f_1\circ \gamma_1=g\circ f_1\circ \gamma_2$. And it seems we wish to use these maps to construct a unique map $T\rightarrow X_1\times_Y X_2$, however I don't agree that this is immediate.
The answerer states that:
In other words, you're given maps $T \to X_1$, $T \to X_2$ and $T \to Y$, such that the two maps $T \to X_i \to Z$ are equal, and the maps the blue path and the red path are equal (where $T$ is in the position of $X_1 \times_Y X_2$). As you can see, this is precisely the same thing as giving two maps $T \to X_i$ such that $T \to X_i \to Y$ are equal, because then the fact that the maps into $Z$ are equal is a consequence of the fact that the maps into $Y$ are equal.
While it is clear that if two maps $T\rightarrow X_i\rightarrow Y$ agree, then the maps $T\rightarrow X_i\rightarrow Z$ agree, I don't think the converse is always true because I think this is equivalent to the statement: $$g\circ f_1\circ \gamma_1=g\circ f_2\circ \gamma_2\Rightarrow f_1\circ \gamma_1=f_2\circ \gamma_2$$ which would imply that $g$ is a monomorphism, which I don't believe we can assume.
Am I missing something here? If not, how can one show that $f_1\circ \gamma_1=f_2\circ \gamma_2$, so that we can get a unique map $m:T\rightarrow X_1\times_Y X_2$? If so, what am I missing?