I would use a mask. Create a new layer, set Force own texture=yes in layer properties. Put black rectangular sprites around the drawing area, set Destination Out blend mode for them. Spawn the line on this layer and move it to the bottom of the layer (masking sprites should be above the line).
The mask will only hide parts of the line which are outside the drawing area and will not affect other layers.
There is a "Blend modes" template in Construct 2, you can check it out.