The difference is 5 water molecules. The decahydrate has 10 water molecules.
If its in a solution, you kinda have to expect you'll have an equilibrium mixture of the 2 substances. You could try using molecular sieves so you can push the synthesis towards the petahydrate. But, I would need to know more details of what exactly you are doing.