Let X ~ N(0,1), E1 ~ N(0,1), E2 ~ N(0,1) all independent of one another. Now let Z = X + E1, and let Y = Z + E2

X and Y are not independent but conditional on Z they are. X and Z are definitely not independent.

So to answer your question - X being independent of Y given Z does not imply that X is independent of Z.