UNiGa crystallizes in the hexagonal ZrNiAl structure and orders antiferromagnetically (AF) below 39.3K with the U moments oriented along the c-axis (easy-magnetization axis). There are four different AF phases in zero-field and two field-induced magnetic phases in UNiGa. A strong uniaxial anisotropy is encountered in this system. Whereas a ferromagnetic state can be induced by a magnetic field higher than 1.2T applied along the hexagonal axis, a magnetic field applied in a perpendicular direction has no influence on the magnetic structure of UNiGa. To date, the magnetic anisotropy in UNiGa has been estimated from bulk magnetic studies, which allow only a qualitative estimate. Here, we report on an anisotropy study by a microscopic method using polarized-neutron scattering on a UNiGa crystal in a magnetic field applied along a direction not parallel to the easy-magnetization direction. The magnetic field forces the U moments to tilt away from the c-axis towards the field direction. The tilting angle is then a direct measure of magnetic-anisotropy energy and leads to a value that is in good agreement with the value derived from bulk magnetic measurements.