I'm not a big fan of stock android and I really like Sony stuff, I'd get the Z1 compact, it's a very nice little phone that's better than S4 in every single aspect. Much faster, better camera, superior audio quality, better screen (debatable, depends how much you like saturated OLED colors with true black vs realistic LCD colors with pure whites and higher brightness), better looking, better customized OS, better preinstalled apps (such as Walkman, Movies, Launcher, Smart Tags, etc), much sturdier, waterproof and it's smaller (might be a con if you want a bigger device).
I can't really recommend the S4 too much honestly, it's a very disappointing phone for me. In fact I'm trying to find someone willing to swap his Z1 Compact for my S4 on local communities.
Basically: Z1C > N5 > S4
I don't know anything about the G2.
Also if you're considering the S4 because of its power and you want to do some high end smartphone usage (gaming, heavy browsing, multitasking) you should take a look at this: