I created a widget with 2 images, one is just placed into the widget with 0,5 alpha, the other one is inside a retainer box with full alpha. The retainer box gets an effect material (I called it M_Retainer) with the texture parameter set to Target.
Then inside the M_Retainer material I created these nodes (the square mask was here on the forum) with the material set to UserInterface and translucent.
Now you could create a dynamic material instance, set the values for x1,x2,y1 and y2 after calculating if the two images are overlapping and set the material to the retainer box to get something like this:



