Fungal prenylated indole alkaloids are a group of biologically diverse natural products featuring a bicyclo[2.2.2]diazaoctane ring system and densely functionalized indole-derived units. However, the detailed mechanisms underlying the assembly of the 2H-pyran moiety and stereochemically diversified bicyclo[2.2.2]diazaoctane systems remain uncharacterized. Herein, we report that the spe gene cluster governs the biosynthesis of notoamide B and its congeners (1–6) in Aspergillus ochraceus. In particular, SpeE, a flavoprotein monooxygenase (FPMO), catalyzed the formation of the 2H-pyran moiety; SpeF and SpeG worked together to produce active unstable intermediates, the 17S-hydroxy-2R,3R-epoxide of notoamide E (16), followed by the sequential inverse electronically demanded hetero-Diels-Alder (IEDHDA) reaction and semipinacol rearrangement (SPR) to construct the bicyclo[2.2.2]diazaoctane core and spiro-oxindole moiety in 1–6. Furthermore, enzymatic and nonenzymatic HDA and SPR steps were distinguished via chemical computations and metabolite profile analysis.