Yes bonsai trees do need sunlight.
For bonsai trees to grow properly and thrive the bonsai tree needs to be in direct sunlight.
Without direct sunlight and enough sunlight the bonsai trees can die and be damaged.
To grow properly and prevent damage to the Bonsai Tree the Bonsai Tree needs at least 5 to 6 hours of sunlight whether indoors or outdoors.
If you have a Bonsai Tree indoors you should place it near a window where it can get direct sunlight on the tree through the window.
Or if you cannot do that use a grow light to help provide some light to it.
But natural sunlight is much better for the Bonsai Tree.