It is often desired to prevent inflow or outflow of liquid around a pipe passing through an opening in a masonry wall. This is particularly important in the installation of manholes for sanitary sewers, since one desires to keep the interior of a manhole reasonably dry. It is known to install sealing elements, or gaskets, around pipes extending through manholes. On example of such gasket is shown in U.S. Pat. No. 3,832,438, issued Aug. 27, 1974, and consists generally of a peak portion which engages the pipe and a leg portion which is embedded in concrete around the peripheral wall of the opening. In the above Patent, the peak portion of the gasket is positioned in a groove formed between the mating edges of two oppositely tapered metal molds. The molds are mounted between the walls of a form and concrete is poured between the walls to embed the leg portion of the gasket in said peripheral wall of the opening when the concrete is set. The above-disclosed apparatus for installing the gasket is expensive since it requires precision machining of the metal molds and differently shaped molds to suit manholes walls of various thicknesses and curvatures.