If you want to erase part of the line when you drag the mouse over it, there's two ways:
The cheating way
Have a background with a solid color, and have the mouse create lines/shapes of that color over your existing line. The player will be given the illusion of the line having been erased, though this approach might fall down on its face if you're trying to do anything reasonably complex.
You could also have a background with a texture, and give it an identical foreground (which is completely transparent, and mouse clicks add to its transparency mask).
The non-cheating way
Detect where the mouse has intersected the line and break the line in two pieces, leaving you drawing multiple lines after multiple erasures (all parallel).
To detect this, each frame, you should determine the vector between the mouse's current position and its position in the previous frame and determine if the line of this vector intersects with the line you've drawn. If so, split the line on the intersection point into two lines, then shorten both slightly (otherwise your erasing will appear to do nothing, since both lines are still perfectly joined).