A masked gated recurrent unit (GRU) model is proposed to establish the mapping relationship between surface pressures on a square cylinder and wake velocities, which can be used to predict statistical and instantaneous aerodynamic pressure fields on a square cylinder from its wakefield. A novel mask net is proposed to figure out one or two wake points where the velocities contribute dominantly to the surface pressure field. A three-dimensional unsteady large-eddy simulation of flow around a square cylinder is performed at Re = 22 000 to generate data for training and validating the proposed models. Results show that local mean pressure coefficients can be well predicted from velocities at even one wake point, but the accuracies of predicting fluctuating pressure coefficients and time-series of local pressure coefficients depend on both the model and the surface pressure location, with more satisfactory predictions achieved in the cross-flow direction. High correlation coefficients of pressure coefficient distributions around a square cylinder between predicted and real distributions are achieved except for the masked GRU model with one wake point. Meanwhile, in terms of the temporal correlation coefficient, all models exhibit good prediction of time-series of pressure coefficients on the side and back surfaces where they are strongly affected by vortex shedding and lower accuracy on the front surface where the pressure coefficients deviate somewhat randomly around the mean value. Large prediction error occurs at the corners of the square cylinder. This study has potential application to risk analysis of structures subject to flow-induced loads.