Whether to use a shotgun or a rifle should depend at least in part on how close the neighbors are and how fond you are of them.
Stopping power is also an issue. 12 Gauge factory loads give you around 1590 foot pounds of muzzle energy. Most 5.56mm loadings have a muzzle energy of around 1250-1290 foot pounds. (For comparison, a .45ACP gives you around 330 foot pounds.) If your round over penetrates it may not impart its full energy to the target - and at across the room distances a 5.56mm round will but a shotgun probably won’t. Either will make your target dead. A shotgun will in most cases tend to make it deader.
Whether to use a shotgun or a rifle should depend at least in part on how close the neighbors are and how fond you are of them.
This is one of the most common myths out there. No offense, really. There is no meaningful penetration difference between buckshot and .223 rounds. Both will go through several (at least 7 or more) normal house walls before coming to a stop. Look for yourself:
The Box O' Truth - Ammo Penetration Testing
Stopping power is also an issue
And there really is no meaningful stopping power difference between buckshot and .223 ammunition. There is no clear proof that the "loss" of kinetic energy via over-pentration plays a part in terminal effectiveness (In ballistics science, this is a controversial point). Either way, buckshot stands just as much of a chance of failing to stop inside the bad guy as does .223 ammunition.
The most important thing, actually, is to use the tool that YOU are comfortable with, that you have confidence in, and that you shoot well.
Assuming that I shot equally well between the two, I'd rather have 30 rounds of .223 coming out of an AR-15 with an 12.5" barrel and a suppressor (compared to a shotgun with an 8 round magazine).