It depends completely on what ROE the invading force is employing and their objective. If it’s Alaric, then yes guns will stop him, Genghis Khan, then no.
More significantly, if the only thing stopping an invader is citizens with guns, then that means the military has been broken, and it is probably over anyways.
I think the argument GM was trying to make is that taking guns from our population through forced confiscation would be costly vs what some other poster had said about winding up as a pile of dust. He alluded to the Japan situation as a point about how costly resistance from an armed population can be.