you have a bad ground somewhere in the circuit. evidently these two are connected to same ground. trace ground wire down or add a strap to frame to ground wire to see if it fixes it.
This will do this, when the engine is not running, cause the pressure switch on the engine does not have any pressure to it. It has a back feed in the system.