Snap to the edges

Hello everyone, i want to animate this plane along this shape with curve modifier, but i want to snap plane edges to the highlighted edgeloop of another shape, anyone can help?
Thank you!