The emerging technique of neutral beam microscopy offers a non-perturbative way of imaging surfaces of various materials which cannot be studied using conventional microscopes. Current neutral beam microscopes use either diffractive focusing or pin-hole scanning to achieve spatial resolution, and are characterised by a strong dependence of the imaging time on the required resolution. In this work we introduce an alternative method for achieving spatial resolution with neutral atom beams which is based on manipulating the magnetic moments of the beam particles in a gradient field, and is characterised by a much weaker dependence of the imaging time on the image resolution. The validity of the imaging approach is demonstrated experimentally by reconstructing one dimensional profiles of the beam which are in good agreement with numerical simulation calculations. Numerical simulations are used to demonstrate the dependence of the signal to noise on the scan resolution and the topography of the sample, and assess the broadening effect due to the spread of velocities of the beam particles. The route towards implementing magnetic encoding in high resolution microscopes is discussed.