If my memory serves me correct, that poem was placed at the Statue about twenty years afterward. The Statue originally had nothing to do with immigration, but liberty.
The poem was written in1883, but was not added to “Liberty Lighting the World” until 1903.