An antenna's gain increases with its directivity. Think about a transmitting antenna - by increasing its directivity (narrowing its beamwidth), the transmitted power is concentrated into a smaller beam. Inside that beam the signal is stronger, which means more gain.
Directivity of an antenna is mainly related to its radiation pattern, and is defined as the maximum power intensity radiated in a certain direction devided by the power intensity radiated by an isotropic antenna in that direction.
While gain of the antenna is the directivity (in dB) minus the losses in the antenna (in dB). These losses are mainly due to ohmic losses if the antenna is a metal antenna, and due to mismatch between antenna input impedance and feed line impedance.
I agree edf and adel_48.
Just add that usually directivity is simple to measure while gain isn't. So, often, commercially speaking, who sell is inclined to speak about "gain" instead "directivity". Of course, gain is lower than directivity.