It seems to me that an arrow $f\in Hom_C(X,Y)$ is given with two maps $dom, codom$ so that $dom(f)=X,codom(f)=Y$. So that, if $$f\in{\bf Hom}_\mathcal{C}(Y,Z)\cap{\bf Hom}_\mathcal{C}(Y',Z')$$ and $$g\in{\bf Hom}_\mathcal{C}(X,Y)\cap{\bf Hom}_\mathcal{C}(X',Y')$$ we must have $X=X',\ Y=Y',\ Z=Z'$. The situation is very much like in graph theory, for the definition of a Directed Multigraph or an automaton. _A Graph (understand Directed Multigraph) $\Gamma$ consists of a set $X=vert\Gamma$ and a set $Y=edge\Gamma$ and two maps $o:\ Y\to X$ (origin) and $t:\ Y\to X$ (target)._ See, for instance, [1].<break> [1] Jean-Pierre Serre (1977), Trees, Springer.