Correlation between elliptic flow and shear viscosity in intermediate-energy heavy-ion collisions