A model is developed for the initial stage of nucleation of III-V nanowires including nitrides (III-V NWs) and other nanostructures grown by selective area epitaxy on masked substrates with regular arrays of pinholes. A criterion for the growth selectivity is obtained, which ensures nucleation of III-V NWs within the pinholes but not on a mask surface. The temperature, group III and V fluxes, pinhole radius and pitch dependences of the selective growth zones are analyzed Keywords: III-V nanowires, selective area epitaxy, masked substrate, nucleation.