Magnetic fields have been observed in galaxy clusters with strengths of the order of $sim mu$G. The non-thermal pressure exerted by magnetic fields also contributes to the total pressure in galaxy clusters and can in turn affect the estimates of the gas mass fraction, $f_{gas}$. In this paper, we have considered a central magnetic field strength of $5mu$G, motivated by observations and simulations of galaxy clusters. The profile of the magnetic field has also been taken from the results obtained from simulations and observations. The role of magnetic field has been taken into account in inferring the gas density distribution through the hydrostatic equilibrium condition (HSE) by including the magnetic pressure. We have found that the resultant gas mass fraction is smaller with magnetic field as compared to that without magnetic field. However, this decrease is dependent on the strength and the profile of the magnetic field. We have also determined the total mass using the NFW profile to check for the dependency of $f_{gas}$ estimates on total mass estimators. From our analysis, we conclude that for the magnetic field strength that galaxy clusters seem to possess, the non-thermal pressure from magnetic fields has an impact of $approx 1~%$ on the gas mass fraction of galaxy clusters. However, with upcoming facilities like Square Kilometre Array (SKA), it can be further expected to improve with more precise observations of the magnetic field strength and profile in galaxy clusters, particularly in the interior region.