Only if you have a charging coil.
That's right, magnetos are made to produce spark to run the engine.
Charging coils are made for running lights and/or charging the battery.
Sometimes small engines come equipped with charging coils, usually just on the electric start models.
But you can sometimes buy a charging coil, the matching flywheel (and possibly the needed rectifier/voltage-regulator) to install a charging system on engines that didn't originally come with them.
If your small industrial engine only has 1 (kill-switch) wire it most likely doesn't have a charging coil.
If your engine has 3 or more wires it might.