Your top layer hasn't been set to be transparent, so when you use the eraser you get the default background color instead of transparency. To set it to be transparent where needed: "Layer>Transparency>Add alpha channel". Then the eraser will work as you think it should.
okyl168's suggestion to use a layer mask has value, this is an improvement on the eraser method where you can easily indicate where the layer should be transparent or opaque just by painting (so you can restore opacity later without having to undo unrelated erasures). Here is a good explanation on layer-masks:
http://blog.patdavid.net/2011/10/gettin ... masks.html