Two gentle rows of virgins, black, speckled, fairest in the land,
From the rich grazing ground of the green, clovered meadow,
Whilst Gwen milked the dozen one by one.
The song's title translates to "The Yellow Cream". It is by the Welsh poet Eifion Wyn. . The complete text is available online.  Its complete storyline involves the (presumably male, given the timeframe and marriage reference) narrator in love with a girl named Gwen, who he helps milk her cows – the virgins in the text above – every day. He's too shy to reveal this to her, but one day as he is anguishing over trying to tell her, she turns to him, as redfaced as he is, and promises to marry him.
The script stated, "He sings the chorus of an old love ballad in either Welsh or Gaelic." The caveat follows, stating, "Selection of ballad must be left to Mr. Doohan since this writer knows nothing of either Gaelic or Welsh." The closed captioning for "The Lorelei Signal" simply overlays the text "Scotty singing melancholically."
The Star Trek Concordance states that this is a "Welsh ballad". It also says that Scott sings this song again in "Mudd's Passion". However, this is either an error or he is singing a different part of the song.