But it does not then logically follow that the market price it takes on is solely determined by the amount of utility.
That's the best you can do? How on earth does that analogy lead us to believe that the "labor" - whatever that is - that went into producing the gasoline has anything to do with its value? To say that unmeasurable "utlity" is not the measure of value hardly establishes that "labor" is the measure of it.
"Social necessity" is not a binary quality. We cannot quantify the "socially necessary" labor without knowing how socially "necessary" the labor is. Indeed, the idea of "necessity" is silly; the real test is "competitive." Value comes from being the better mousetrap, not from being a mousetrap. Does the obsolete mousetrap's production suddenly become socially unnecessary labor?
The knots people tie themselves in to defend this stunningly stupid idea is mind-boggling.