How do make a layer visible only when overlapping other layers in After Effects
You can use a Track Matte. If your vertical lines aren't already precomposed, precompose them. Duplicate the Precomposition in your main composition. Place the shadow layer between the two precomps. Set the shadow layer's TrkMat setting to Alpha. (If you can't see the Track Matte [TrkMat] dropdown press the Toggle Switches/Modes button at the bottom of your screen).