I don't know how it was done but...
You could use a short length of rubber/silicone hose that is a snug fit on the body of the gauge and push this on to help hold the gauge in the dash. then cut a snug hole in the side of this hose to grip the bulb carrier in the same way. (That's if the gauge has a hole for the bulb to poke into) Otherwise another smaller piece of rubber hose superglued to the side hole to hold the bulb carrier.
Well I know what I mean