NGS and some AA and anti shipping may be the primary uses of the 5in at the moment, but one also has to also look at potential future developments such as improved AA (the US has used 155mm guns to shoot down drones in tests), HVPs and the Kingfisher gun launched ASW depth charge.The Constellation will use a 57mm gun (Mk110, a rebadged Bofors 57 mod3) so it is becomming more common, even on larger ships. I think it fits into the Constellation armament as an inner circle low cost anti boat and drone system. It's good for about 8-10km and leaves the more expensive RIM116 for close in missile threats, and ESSM,SM2/SM6 for the longer distance stuff.
Probably a good option for asymetic or swarm threat environments such as the Red Sea or for general purpose requirements such as piracy, force protection, bording and the like.
I think the USN went the 57mm for the Constellations as it is already in their system, being used on the LCS and across the Coastguard. And for the low end threat (drones, boats etc) it is just as good as the larger 76mm gun. No need to go for the extra expense of the larger calibre.
The 127mm gun is good for about 25 km, and aligns more with strike capability (albeit close in shore bombardment). Good for stuff where a Tomahawk or NSM is overkill as they are a lot cheaper per shell and there is a lot more onboard (in the hundreds of shells). Perhaps useful in cleaning up an island where an NSM had earlier destroyed the anti ship defence and you can get within range. Or support to an amphibious team landing to keep an enemy at distance.
In the late stage of a battle, when missiles have been depleted or in short supply on both sides (a real possibility), then the 127mm gun becomes an anti ship weapon. Eventually gun fights become knife fights if they go on long enough, and the 127mm has a long blade (potentially a confusing metaphore, my apologies).
Aparently it is possible to launch a 127mm shell at an aircraft. Some shells are proximity rather than contact fused. Wanna be a good shot, but would unlikely need a second one. I'm not thinking this is its ideal purpose though and is a bit of a hail Mary option.
An old WEEO friend of mine once let me know that back in the day before ESSM and when the ANZACs only had two fire channels, the 5 inch gun could be used as a sea skimming missile defence by firing into the water in front of it to create a water shield. Never saw it and unsure how useful it would be, but I could well imagine it would put up a big splash.
I still like the inclusion of the 5 incher. Its a usefull baseball bat.
I think it pairs really well with a smaller calibre gun in the 30-57mm range for the best of both worlds.
All good reasons to keep the 5in.