A drunken man was electrocuted and killed relieving himself on the third rail in Brooklyn this morning, sources said.

Matthew Zeno, 30, was walking with a friend along the tracks for the southbound G train around 3:10 a.m., at Union Avenue and Broadway in Williamsburg when the horrific accident occurred, cops said.

His 26-year-old pal tried saving him and was also shocked, police added. The friend was able to flag down MTA workers, who in turn called for help, sources said.

Both men were rushed to Woodhull Hospital where Zeno died and the second man was listed in stable condition.

Click for more from the New York Post.