When two vessels in a side-by-side configuration are under wave actions, fluid resonance occurs in a narrow gap between two vessels, termed ‘gap resonance’, leading to large free-surface responses. Large free-surface responses due to gap resonance can induce large relative motions and drift forces by both vessels, which influences operational safety. The present study aims at investigating the free-surface response near resonance in a narrow gap between two fixed, identical barges with square corners numerically and experimentally. Gap resonance is driven by three typical incident wave conditions including beam sea, quartering sea, and head sea. In light of the fact that the potential-flow theory overestimates the response in the gap, a potential-flow model with energy dissipation effects is developed based on the boundary element method. A dissipation surface is devised at the bottom opening as well as two end openings of the gap. Both linear and quadratic damping terms associated with laminar boundary layer wall friction and flow separation from sharp corners are accounted for. Physical experiments of gap resonance excited by irregular waves with different significant wave heights and peak periods are carried out and used for calibration and validation of the potential-flow model. Nonlinear correlation is observed between the incident wave amplitude and resonant gap response, which is predicted with satisfactory agreement by the developed potential-flow model. In-depth discussion on the mode shapes is made. It is found that the first mode is predominant in the beam sea, and the natural modes exhibit standing wave behaviors. Under quartering sea and head sea excitations, the second and third modes dominate over other modes. Waves propagate slowly along the gap in the head sea condition. Under the quartering sea excitation, the first and second modes propagate along the gap, but the third mode exhibits standing wave behavior, indicating the quartering sea response is a transition between head sea and beam sea. The significance of the present study is threefold. Firstly, the experimental measurements provide reference results for numerical simulation. Secondly, a simple but effective damping model to suppress unrealistic free-surface response near resonance is developed. Lastly, this work gives an insight into the spatial structure and dominance of natural modes under different wave conditions.