First to correct. The Gibbs energy is NOT an indicator of spontaneous change. It is only that at constant T and P. If one or the other is not constant, then the Gibbs energy does not tell us about spontaneity. (At constant T and V, for example, the Helmholtz energy must be used, like in a bomb calorimeter).
The second thing you have a bit wrong is that the enthalpy is equal to the heat ONLY at constant pressure:
dH = dU + d(PV) = dq + dw + d(PV)
or at constant P
dH = dq
P +(-PdV) + PdV, or dH = dq
P.
I put a subscript P on dq because it is the heat at constant pressure.
So you have to be careful and always be aware which variables are fixed when using thermo properties.
Let us suppose you are doing an experiment on a bench top, so P and T are constant. The Gibb's energy is given by
G = H-TS
and the enthalpy is given by
H = U +PV
So put them together:
G = U + PV -TS
Now suppose we are at constant P and T and look at a change:
dG = dU+PdV-TdS
But you want no PV work, so
dG = dU-TdS=dq
P+dw
non-PV work)-TdS
Now the most efficient path between any two states is the reversible path. For a reversible path you must have
dq
P=TdS
and so you find:
dG = dw
non-PV work) (only at constant T and P)
which I hope answers your question.
This is discussed in section 3.7 of my Physical Chemistry text book,
http://www.mchmultimedia.com/store/Thermodynamics.html