Trapping of vortices in a cavity has been explored in recent years as a drag reduction measure for thick airfoils. If, however, trapping fails, then oscillation of the cavity flow may couple with elastic vibration modes of the airfoil. To examine this scenario, the effect of small amplitude vertical motion on the oscillation of the shear layer above the cavity is studied by acoustic forcing simulating a vertical translation of a modified NACA0018 profile. At low Reynolds numbers based on the chord (O(104)), natural instability modes of this shear layer are observed for Strouhal numbers based on the cavity width of order unity. Acoustic forcing sufficiently close to the natural instability frequency induces a strong non-linear response due to lock-in of the shear layer. At higher Reynolds numbers (above 105) for Strouhal number 0.6 or lower, no natural instabilities of the shear layer and only a linear response to forcing were observed. The dynamical pressure difference across the airfoil is then dominated by added mass effects, as was confirmed by numerical simulations.