The deformation of the gantry structure in heavy-duty machine tools is an important factor that affects machining accuracy. In order to realize real-time monitoring of the deformation of the gantry structure, which is statically indeterminate and complex in shape, the reconstruction algorithm based on inverse Finite Element Method (iFEM) is proposed and fiber Bragg grating (FBG) sensors are used to measure strain data. The elements of the gantry structure are divided and the displacement functions of each element are determined. The shape function is obtained by substituting degree of freedoms (DOF) of element nodes into displacement functions. Through a differential method, the relation between strain and DOF of element nodes is established by the strain matrices. Subsequently, the DOF of element nodes are obtained by minimizing an error functional defined as the least-squares error between the analytic strain data and the corresponding experimental strains. Considering coordinate transformation and problem-specific displacement boundary conditions, the total deformation of the gantry structure is obtained. Following this, the experiment was carried out. The deformation simulated by ANSYS was used to replace the experimentally measured deformation and then compared with the deformation reconstructed by iFEM under the same loading condition. The accuracy of iFEM for reconstructing deformation of the gantry structure in heavy-duty machine tools is verified. It provides a new view for improving the machining precision of heavy-duty machine tools.