The triangles are similar triangle because they have base angles that are congruent (transversals of parallel lines) and their third angles are equal because they form vertical angles.
Since the triangles are similar, their side lengths are proportional to each other. Set up a proportion...
5/10 = x/8 (side with length of 5 corresponds to side with length of 10)