Take object color of underlying Emitter
You can do it in a similar way as described in the linked answer.

Just copy your material node setup from the cube to the icosphere, change the coordinate type from Generated to Object and choose the cube object from the list.