I’m trying to eliminate what it’s probably not. Since it starts and runs it’s probably not ignition. Since it runs for 5 seconds, it’s probably not the amount of gas in the float bowl because that’s usually enough gas to run for maybe 30 seconds or more if no new gas was getting in. And you said you are pretty sure the gas is getting through.
It would be helpful to hear how it stops running. For example if it starts with the choke on (closed to restrict the air intake) it might only run for about 5 seconds and die from too rich of a mixture. I assume you turn the choke off once it starts. Although a cold engine might die if you turn the choke off too soon also, and that would happen in about 5 seconds because the mixture is too lean - not enough gas. If this is the case, leaving the choke on when it starts should make it run a bit longer and indicate that the mixture is too lean.
You can try a couple of things to check the mixture. You could carefully squirt some raw gas into the carburetor intake (take off the air cleaner so you can see the choke and the throttle butterfly), once you get it started. This could be tricky and dangerous. If you have starter fluid, which is basically ether in a can, that would work, or even carburetor cleaner which is combustible might work. Anything to add richness to the mixture going into the engine - if this keeps the engine running longer, it’s a sign that the engine isn’t getting enough gas.
Or, here’s another thing to try: there are usually two screws on the carb. The idle adjustment, and the idle mixture adjustment. With the air cleaner off, you should be able to see the idle adjustment screw open of close the throttle butterfly - the one “behind” the choke butterfly.
The mixture screw: screw this in, clockwise, but carefully count the number of turns. I count half turns. Most screws are about one and a half or two turns out, ie 3 or 4 half turns. Count the turns so you can put it back where it started. Then take it all the way out - don’t lose the spring if it has one. The spring keeps the screw from turning while the engine is running. Then squirt carb cleaner into the hole. This will hopefully clean out any gummy stuff inside the carb’s idle mixture plumbing. Put the screw back in and try it. Then turn the screw in maybe a half turn, and out a half turn from where it was. See if this changes anything. If it runs longer, keep experimenting and maybe you can get it happy.
The other thing that messes with air gas mixture is if the carburetor is not tight on the engine, so air leaks in and leans the mixture. Check the mounting screws.