G=H-TS
So you can write
dG = dU + pdV + Vdp - TdS - sdT
If T and P are constant:
dG= dU + pdV - Tds
Now dU is q+w+w' where w is the expansion work (-pdV) and w' is the non-expansion work.
dG = q-pdV+w'+pdV -Tds
dG= q+w'-Tds
but q=Tds (rev) or q>_Tds
so
dG = w'