You should use
gpu_set_blendmode_ext_sepalpha(source, destination, source alpha, destination alpha). As you could glean from the name, this function works exactly like gpu_set_blendmode_ext but gives you even finer control by letting you specify separate blend modes for the alpha values.
More specifically, the combination of blendmodes you are looking for is
Code:
gpu_set_blendmode_ext_sepalpha(bm_zero, bm_one, bm_one, bm_zero);
Because, from your description, you want the already existing (destination) color to be filtered by the mask's (source) alpha. So this means that each resulting pixel should be (Rd, Gd, Bd, As).
The first bm_zero discards the source colour values, while the first bm_one keeps the destination color. Likewise, the second bm_one keeps the source alpha value while bm_zero discards the destination alpha value.
Thus...
(0, 0, 0, As) + (Rd, Gd, Bd, 0) = (Rd, Gd, Bd, As)