There was a thread about summoning a stamp for the Darkling City, and another thread about summoning stamps for Burning Land tiles.
Maybe you can create a stamp which already contains your unique resource and summon it? To have it only done once, you could set cooldown to something like 800. (or whatever max game turns is these days).
As a wild guess, I would make a 2-stage improvement that gives the bonus on the "second" stage, the upgrade. Most people won't raze a second-level city.
I have some buildings on the Nexus which give bonus resources you can look at and use as a design template if you want.
You can set <RequiresCityImprovement>1</RequiresCityImprovement> and make a second building which either upgrades to, or depends on the one you want to give the ability to. You can try giving Prereq of a unique improvement.
My final option is to find the spot where the Capital City is hardcoded, and use that to make it Capital Only.