No, it is not necessary to have an internet connection to use Nearby Share. The feature works without an internet connection.