Nicotinamide N-methyltransferase (NNMT) transfers the methyl from S-adenosyl-L-methionine (SAM) to nicotinamide (NA) to produce S-adenosyl-L-homocysteine (SAH) and 1-methylnicotinamide (MeN). NNMT has been implicated in a variety of diseases; however, the role of NNMT in drug addiction is largely unknown. Here, we found that the expression of Nnmt was significantly upregulated in the dorsal striatum (DS) of cocaine-conditioned mice. Cocaine significantly decreased SAM/SAH ratio levels in the DS, which was accompanied with the decreased activities of Rac1 and RhoA. Lentivirus-mediated knockdown of Nnmt in the dorsomedial striatum (DMS) attenuated cocaine conditioned place preference (CPP) reward, but increased striatal SAM/SAH ratio levels as well as Rac1 and RhoA activities. In addition, pharmacological inhibition of NNMT through intra-DMS infusion of MeN attenuated cocaine CPP and the activities of Rac1 and RhoA, but increased SAM/SAH ratio. These results suggest that NNMT-dependent transmethylation is involved in the activation of Rac1 and RhoA, which utilize SAM as a methyl donor cofactor. Co-immunoprecipitation assay using a RhoGDIα antibody indirectly captured Rac1 or RhoA that were bound to RhoGDIα. The results showed that cocaine increased the association of RhoGDIα with Rac1 or RhoA, whereas such effect was inhibited by Nnmt knockdown. Collectively, our findings show that NNMT regulates cocaine CPP through SAM-mediated modification of Rac1 and RhoA.