With the Libretro DOSBox Pure core, you can activate the mouse control to use it with one of the sticks of your controller.
To use the mouse on a joystick of your controller, there is a manipulation to do in the options of RetroArch. We will see below how to use the mouse on the right joystick.
Mouse with Right Analog Stick
.