Natural products with the 3,6‐diene‐2,5‐diketopiperazine core are widely distributed in nature; however, the biosynthetic mechanism of 3,6‐diene‐2,5‐diketopiperazine in fungi remains to be further elucidated. Through heterologous expression and biochemical investigation of an FeII/2‐oxoglutarate‐dependent oxidase (AspE) and a heme‐dependent P450 enzyme (AspF), we report that AspE, AspF and subsequent dehydration account for the formation of the 3,6‐diene‐2,5‐diketopiperazine substructure of brevianamide K from Aspergillus sp. SK‐28, a symbiotic fungus of mangrove plant Kandelia candel. More interestingly, in‐depth investigation of the enzymatic mechanism showed that AspE promotes hydroxylation of brevianamide Q with unprecedented stereoinversion through hydrogen atom abstraction and water nucleophilic attack from the opposite face of the resultant iminium cation intermediate.