The hydrodynamics of a variant of classical Bondi-Hoyle-Lyttleton accretion is investigated: a totally absorbing sphere moves at various Mach numbers (3 and 10) relative to a medium, which is taken to be an ideal gas having a density gradient (of 3%, 20% or 100% over one accretion radius) perpendicular to the relative motion. Similarly to the 3D models published previously, both with velocity gradients and without, the models with a density gradient presented here exhibit non-stationary flow patterns, although the Mach cone remains fairly stable. The accretion rates of mass, linear and angular momenta do not fluctuate as strongly as published previously for 2D models. No obvious trend of the dependency of mass accretion rate fluctuations on the density gradient can be discerned. The average specific angular momentum accreted is roughly between zero and 70% of the total angular momentum available in the accretion cylinder in the cases where the average is prograde. Due to the large fluctuations during accretion, the average angular momentum of some models is retrograde by up to 25%. Small gradients hardly influence the average accretion rates as compared to accretion from a homogeneous medium, while very large ones succeed to dominate and form an accretion flow in which the sense of rotation is not inverted.