Both, surely...
You need both the large mass and to arrange it in that high density form to get the obvious lensing - neither on their own produces the extreme effect, be that a lower density stellar body or a solitary atomic nucleus wondering where its electrons have gotten to.
Density of non sequence objects:
White dwarf 10
9 kg/m
3
Neutron star 10
17 kg/m
3
Black hole 10
30 kg/m
3
Mass of non-sequnce objects
White dwarf ~1 solar mass
Neutron star ~1.5 solar masses
Black hole ~2.5 solar masses
So first off just looking at these two sets of numbers, the masses are (on astronomical scales) roughly
equal. Meanwhile the densities differences are HUGE. Larger in fact that the number of planets in a galaxy.
Second, the amount of lensing depends primarily on the distance and the density. The mass is at most a tertiary factor that influences the density based on degeneracy pressure regimes. For instance, small mass black holes that are barely larger than a neutron star can have as much lensing as Sgr A* if you get a few km away. Which you can do. But neutron stars only a fraction of a solar mass lighter will force you to keep a distance that keeps the lensing very mild.
Meanwhile white dwarfs allow you to get very close and some have masses similar to neutron stars, but the lensing is least noticeable of all three objects.