Clean the masonry surface around the pipe with a wire brush. Remove debris from around the pipe with a shop vacuum.
Insert a tube of exterior-grade silicone-based masonry caulk into a caulking gun for gaps around pipes less than 1/4 inch. If the gap is greater than 1/4 inch, choose an expandable foam sealer.
Position the straw-like applicator on the foam sealer into the space around the pipe and depress the trigger. Move around the pipe as you express the sealant. The sealant will expand past flush with the masonry wall, this is normal. If you are using caulk, place the tip of the masonry caulking tube over the gap and press the caulking gun trigger as you are moving around the pipe. Wet you finger and press the caulking into the gap between the pipe and masonry surface to form a tight plug. Inspect the seal to determine whether foam or caulk fully covers the gap. Add more caulk or sealant if necessary. Allow the caulking or sealant to dry fully. Drying times vary based on temperature, humidity and the type of product.
Apply a second layer of caulk over the first layer. Spread the caulk out over the seam between the pipe and caulk and the seam between the masonry surface and caulk to form a tight bond.
Clean the cinder block surface with a wire brush. Vacuum away all dust and debris.
Apply a thick coat of fiber-thickened epoxy with a disposable plastic putty knife.
Press the epoxy into the void space around the pipe. Build the layers up to flush with the existing wall.
Spread a 1/4-inch-thick layer of epoxy over the first layer and 1 to 2 inches beyond the edge of the hole.
Clean the gap with a wire brush and vacuum away all dirt and debris.
Scoop up hydraulic cement onto a metal putty knife. Force the hydraulic cement into the gap so it fills all voids from the pipe to the masonry wall.
Spread a second layer of hydraulic cement over the first layer to cover the patch and 1 to 2 inches past the edge of the hole.