Messier 51 refers to the connected pair of galaxies known as Messier 51a (NGC 5194) and Messier 51b (NGC 5195). It is also known as the Whirlpool Galaxy although technically that name applies to Messier 51a rather than both.
https://github.com/davepinch/pinchy.cc/blob/master/content/topics/astronomy/catalogs/messier/messier-51/messier-51.md