We study the intrinsic nature of the finite system-size effect in estimating shear viscosity of dilute and dense fluids within the framework of the Green-Kubo approach. From extensive molecular dynamics simulations, we observe that the size effect on shear viscosity is characterized by an oscillatory behavior with respect to system size L at high density and by a scaling behavior with an L-1 correction term at low density. Analysis of the potential contribution in the shear-stress autocorrelation function reveals that the former is configurational and is attributed to the inaccurate description of the long-range spatial correlations in finite systems. Observation of the long-time inverse-power decay in the kinetic contribution confirms its hydrodynamic nature. The L-1 correction term of shear viscosity is explained by the sensitive change in the long-time tail obtained from a finite system.