O-methyltransferase; part of the gene cluster that mediates the biosynthesis of nectriapyrone and its analogs phomopyrone A, acropyrone and zaepyrone (PubMed:30443971). The nectriapyrone biosynthetic gene cluster consists of two genes, the highly reducing polyketide synthase NEC1 that produces a demethylated analog of nectriapyrone from one unit of acetyl-CoA and one unit of malonyl-CoA; and the O-methyltransferase NEC2 that further methylates the NEC1 product to yield nectriapyrone (PubMed:30443971). Nectriapyrone is further hydrolyzed to nectriapyrone D, also known as gulypyrone B, by an unidentified hydrolase localized outside the nectriapyrone cluster (PubMed:30443971). desmethylnectriapyrone + S-adenosyl-L-methionine = H(+) + nectriapyrone + S-adenosyl-L-homocysteine Completely abolishes the production of nectriapyrones but accumulates a demethylated analog of nectriapyrone. Belongs to the methyltransferase superfamily.