I have three 3D points like p1(x1,y1,z1), p2(x2,y2,z2), p3(x3,y3,z3).
I have another point, but I know only x, y
p1, p2, p3 define a plane. You can represent it by a point and a normal. For instance, P=p1, N=(p2-P) x (p3-P) (that is, N = cross product of p1p2 and p1p3).
Now for p4 to be in the same plane, it satisfies the plane equation:
(p4-P) · N = 0 %// dot product
⇒ (x4-x1)*N.x + (y4-y1)*N.y + (z4-z1)*N.z = 0
Re-arranging:
z4 = z1 - ((x4-x1)*N.x + (y4-y1)*N.y)/ N.z
No linear system to solve, you just need a cross product.