In the Output menu, you can set up preferences to render the mask. See Processing Multiple Outputs.
To make the mask visible in the output, enable Use GMask in the Render Options panel.
The mask output in the render is dependent on the settings of the Type box In the Output Options panel. Do any of the following: