There is not a straightforward relation between a galaxy's luminosity and its mass. The luminosity depends on how much present and recent star formation there has been. Some very massive elliptical galaxies have little star formation going on, so they are not particularly luminous for their mass.
To understand why this is so, consider stars converting hydrogen to helium, and lying on the "Main Sequence" (see Wikipedia) in the Luminosity-Color (Hertzsprung-Russell) diagram. On the Main Sequence, stars burn with a luminosity which is proportional to their mass to about the 3.5 power. The Sun is a Main Sequence star, and a blue B-type star on the Main Sequence might have 30 times the Sun's mass and 100,000 times the luminosity, and a red M-type star on the Main Sequence might only one-tenth the Sun's mass and less than a thousandth of the luminosity. Since the lifetime of a star depends on the mass divided by the luminosity, stars much more massive than the Sun will have short lifetimes (millions of years) and stars much less massive than the Sun will have very long lifetimes (trillions of years).
After they exhaust the hydrogen, the stars will go through a relatively brief giant phase where they are even more luminous for a short while, but then gradually fade into a white dwarf that still has a lot of mass but very little luminosity. The upshot is that soon after a burst of star formation,a galaxy will glow brightly with massive main sequence stars and stars in the giant phase. But a long time later, the luminosity will be dominated by white dwarfs and red main sequence stars, both of which give off very little luminosity for their mass.