From the Super Mario Wiki
Sap is a gelatinous substance found in the Tree Zone in Super Mario Land 2: 6 Golden Coins. Mario can use it to get across spikes by jumping inside and "swimming" through it to a safe area. It only appears in area 2 but is on almost every wall and fills the small gaps between floors. Several enemies float inside it, adding to the difficulty of traversing it.