Maybe part of a specialized funnel? For loading gun powder?
uh try its a opium pipe the tar like substance is opium residue ...the brass pipe bowl was meant to heat up to allow the tar like opium ball to heat up and release its fumes ... often they had a wooden reed stem on them ..