This process is called clipping.
In your case, you have a polygon defined by 4 vertices (including their positions and UV coordinates). You split this via a line given by two points.
A simple algorithm would check on which side of the line each of the 4 points is. If it is on the left side, add it to your first result, if it is on the right side, add it to your second. If two consecutive vertices end up on different sides of the line, you need to compute the intersection of the line and that edge and add it to both results.