How do I get this PFET to switch off when G=5V (high)
The problem with this circuit is that the PMOS M1 will never turn off.

PMOS needs the gate to be within a few volts of the source to turn off.  While on, you have a voltage divider consisting of R1 and R2, I am assuming, in an attempt to keep the source of M1 at around 5V (not the 15V you replied in a comment).  This works until you attempt to turn off the PMOS by bringing the gate up to 5V.  As the PMOS tries to turn off the channel between source and drain becomes resistive, raising the voltage on the source towards 20V.  You won't even be able to turn it off that much because once the source is 7V or higher, Vgs will be too big and keep the device conducting. 

If the PMOS were somehow truly off, you would have 20V on the source and 5V on the gate.  i.e. it will always be at least partially on.