Depends how steady your hand is. With a mask, black =transparency white=opacity greys=between the two.
Sorry about the image, the only one handy with a sky. After applying the gradient, paint inside the foreground.
This maybe a bit easier to see: https://i.imgur.com/gNK5vpO.jpg standard brush / white FG
For painting straight lines click-beginning / shift / click-end of line, or you could zip around the outline with free select, fill the selection with white.
If you wanted to make a selection of the foreground with the free select tool before applying the gradient then invert the selection -> apply gradient.
Sorry about the image, the only one handy with a sky. After applying the gradient, paint inside the foreground.
This maybe a bit easier to see: https://i.imgur.com/gNK5vpO.jpg standard brush / white FG
For painting straight lines click-beginning / shift / click-end of line, or you could zip around the outline with free select, fill the selection with white.
If you wanted to make a selection of the foreground with the free select tool before applying the gradient then invert the selection -> apply gradient.