Yes, it can be attacked even if the players haven't registered for a battle. In this case, they get a notification that another gang has started an attack instead of the usual message that they have started an attack.

The system would resort to matching a gang that doesn't have all required member enlisted yet only if there is a natural shortage of opponents in the district and if the other gang has been waiting for a while already (this can happen if the other gang finished the attack earlier or if your gang did the same which made it the first available in the matching pool).