They depend on different things. Gyroscopic precession occurs when you change the propeller's attitude- it causes a yawing tendency to the left when the counter-clockwise propeller is pitched up and to the right when it is pitched down. How big this effect is depends on how abruptly the pitch is changed.
P-factor depends on the current angle of attack of the propeller blades. Typically the plane is flown so that the descending blade has a higher angle of attack than the ascending blade, which causes it to produce more thrust. This causes a yaw to the right for a counter-clockwise propeller.
So both gyroscopic procession and p-factor can be in the same direction in some occasions. For instance, if the nose and angle of attack are initially high and they are quickly lowered, then both gyroscopic procession and p-factor will be to the right while the nose is being lowered.