The first is valid but not the second.For a point inside the elevator, pressure can be defined as P=limΔs→0​ΔSF​. It is independent of the acceleration of the elevator.The modified form of the second equation, which will be valid in the given case, is given by P1​−P2​=ρ(g+a0​)z Here, acceleration a0​ (say) due to elevator accelerating upwards is also taken into account.