Yes, the angle is found in the vector between the cursor and the gun tip (or aim origin).
var ang = (get_global_mouse_position() - gun_tip.get_global_pos()).angle()
Just make sure your angles match Godot, or do a conversion on your angles.
0 points down, 180 and -180 point up.
From 0 heading clockwise will cover 0 to -PI (-180), and the counter-clockwise direction covers 0 to +PI (+180).