edit: As Li Zhan points out, I misunderstood the question. I will leave what I had written here anyways.
Your last sentence should read "However, I don't know how to show this fibre product is $G \times_S X'$", i.e. it should be $X'$ instead of $X$.
The answer to your question follows from a more general fact, namely that towers of fibered squares are fibered squares (this is exercise 2.3.P in Vakil's FOAG, version of May, 16th).
Suppose that we have some category and two fibered squares
$W \longrightarrow Y$
$\downarrow \,\,\,\,\,\,\,\,\,\,\,\,\,\,\, \downarrow$
$X \longrightarrow\,\, Z$
and
$W \longrightarrow Y$
$\downarrow \,\,\,\,\,\,\,\,\,\,\,\,\,\,\, \downarrow$
$X \longrightarrow\,\, Z$
i.e. $W = Y\times_Z X$ and $U = W\times_X V$. Then if we put them toghether we get the diagram
$U \longrightarrow W \longrightarrow Y$
$\downarrow \,\,\,\,\,\,\,\,\,\,\,\,\,\,\, \downarrow \,\,\,\,\,\,\,\,\,\,\,\,\,\,\, \downarrow$
$V \longrightarrow X \longrightarrow\,\, Z$.
The claim is now that the outer rectangle
$U \longrightarrow Y$
$\downarrow \,\,\,\,\,\,\,\,\,\,\,\,\,\,\, \downarrow$
$V \longrightarrow\,\, Z$
is again a fibered square (so the horizontal morphisms are the compositions of the morphisms in the single diagrams), i.e. $U = Y\times_Z V$.