To answer your question, IMHO, a shot of espresso is 1 fluid oz. I would think this significantly too little espresso for 5g unless you are looking for a very delicate flavor.
More generally about espresso: In addition to D.C.'s sensible answer, I want to add that you can do whatever you want with coffee/espresso and it will probably work out at least ok. I have added espresso to all phases of brewing from wort to primary fermentation to secondary to bottling in all forms from grounds to shots to cold toddies. The advantage of after fermentation is control of flavor. The advantage of shots is no grounds. The advantage of just chucking in a 1 lb of espresso while boiling the wort is ease (for the record, that flavor will not be 'delicate' but coffee drinkers will probably like it). About the only thing you can do wrong is leave your bottles of coffee stout aging. The coffee does not, in my experience, improve with time.