You'll want an algorithm along the lines of:
- Draw image A onto canvas 1
- Clear canvas 2
- Draw a partial circle on canvas 2, for the current state of the spinner, filled with white
- Blit image B onto canvas 2, using the multiplicative blending mode
- Blit canvas 2 onto canvas 1, using standard (replace) blending
Canvas 2 should contain the second image, masked by the section you want to use. Overlaying that onto canvas 1, provided you handle transparency properly, should give the effect you want.
You can also use two SVG circles with image backgrounds and do this trivially, assuming your target browsers support SVG.