Indeed, this is how a lot of hydraulic accumulators were designed prior to 1950s.
Honestly though, it's a shitload easier and cheaper buying a good spunding valve than trying to rig up some hydraulic rig to apply backpressure to your keg. The CO2 needs to be exhausted, so if you were going down...