Oakum
Oakum can be used to seal cast iron pipe drains. After setting the pipes together, workers pack oakum into the joints, then pour molten lead into the joint to create a permanent seal. The oakum swells and seals the joint, the "tar" in the oakum prevents rot, and the lead keeps the joint physically tight.
Today, modern methods, such as rubber seals (for example, gaskets or o-rings) are more common.
Coal tar
Pine tar has historically also been used for this purpose. Though it is frequently cited online as having been banned as a medical product by the FDA due to a "lack of evidence having been submitted for proof of effectiveness", pine tar is included in the Code of Federal Regulations, subchapter D: Drugs for Human Use, as an OTC treatment for "Dandruff/seborrheic dermatitis/psoriasis".