The problem is
I have been able to prove $left hand \rightarrow composite$, but I haven't be able to prove the reverse direction, so if you could point to me in the right direction via hint, I would really appreciate it.
My attempt:
So the situation is as follows:
Given $f: Q \rightarrow B$ and $g: Q \rightarrow D$, we need a unique $h: Q \rightarrow A$ such that
-$f = h_1 h $
-$g = h_6h$
Now, the right hand square is a pull back, hence there exists a unique $k: Q \rightarrow B$ such that
-$h_2 k = h_2 f$
-$h_7 k = h_5 g$
And as the composite rectangle is a pull back, there exists a uniqu $i: Q \rightarrow A$ such that
-$(h_2h_1)i = h_2 f$
-$h_6 i = g$
Note
$h_7(h_1 i) = (h_7 h_1) i = (h_5 h_6) i = h_5 g$
$h_2(h_1 i) = h_2 f$.
So by uniqueness of $k$, $k = h_1 i $
There also exists unique $i': Q \rightarrow A$ such that
-$(h_2 h_1)i' = h_2 k$
-$h_6 i' = f$
By uniqueness, $i' = i$
And I'm not sure how to proceed from here.
Thanks for your help!


I suspect Rick's answer is basically right, but I haven't fully checked it. However, it doesn't seem to address some problems with your argument in your question, so I thought I'd add another answer.
First of all, your hypotheses.
You are taking $f:Q\to B$ and $g:Q\to D$, and then trying to construct $h:Q\to A$ such that $$f=h_1h\text{ and } g=h_6h.$$
This is not the universal property of the pullback! You can only construct such an $h$ if $f$ and $g$ make their square commute, i.e., if they satisfy $$h_7f = h_5g. $$ We therefore should assume this as well.
Second, $k$ is actually $f$ in disguise
Actually, this again boils down to a misunderstanding of the universal property of the pullback, since you aren't assuming any commutativity conditions on $f$ and $g$, you don't know that the $k$ in your question exists. However, once you assume the correct commutativity conditions on $f$ and $g$, we get that $k$ and $f$ are both solutions to the same universal property question, so you can just skip this step.
The next step is correct
Next we consider the pair of maps $h_2f : Q\to C$ and $g:Q\to D$. Since the right square commutes, and we know $h_7f = h_5g$, we have $$h_3h_2f = h_4h_7f = h_4h_5g,$$ so we satisfy the requirements of the universal property of the pullback for the outer rectangle.
Thus we can find a map $i:Q\to A$ such that $h_2f = h2h_1i$ and $g= h_6i$.
Now we just need to show $f=h_1i$, and we'll know that $i$ is our desired map.
To check this, by the uniqueness part of the universal property of the pullback for the right hand square, it suffices to show that both $$h_7f=h_7h_1i\text{ and } h_2f=h_2h_1i.$$ The second property is true by construction of $i$, so we just need to check the first property. For the first we have: $$h_7h_1i = h_5h_6i = h_5g = h_7f,$$ where the equalities follow, since (1) the left hand square commutes, (2) by construction of $i$, and (3) the assumed commutativity property on $f$ and $g$.