Biosynthetic pathways containing multiple core enzymes have potential to produce structurally complex natural products. Here we mined a fungal gene cluster that contains two predicted terpene cyclases (TCs) and a nonribosomal peptide synthetase (NRPS). We showed the flv pathway produces flavunoidine 1, an alkaloidal terpenoid. The core of 1 is a tetracyclic, cage-like, and oxygenated sesquiterpene that is connected to dimethylcadaverine via a C-N bond and is acylated with 5,5-dimethyl-l-pipecolate. The roles of all flv enzymes are established on the basis of metabolite analysis from heterologous expression.