$^4$He confined in nanoporous media is a model Bose system that exhibits quantum phase transition (QPT) by varying pressure. We have precisely determined the critical exponent of the superfluid density of $^4$He in porous Gelsil glasses with pore size of 3.0 nm using the Helmholtz resonator technique. The critical exponent $zeta$ of the superfluid density was found to be 1.0 $pm$ 0.1 for the pressure range 0.1 < P < 2.4 MPa. This value provides decisive evidence that the finite-temperature superfluid transition belongs to the four-dimensional (4D) XY universality class, in contrast to the classical 3D XY one in bulk liquid 4He, in which $zeta$ = 0.67. The quantum critical behavior at a finite temperature is understood by strong phase fluctuation in local Bose-Einstein condensates above the superfluid transition temperature. $^4$He in nanoporous media is a unique example in which quantum criticality emerges not only at 0 K but at finite temperatures.