To investigate the difference between rumen-protected niacin (RPN) and rumen-protected nicotinamide (RPM) in the transcriptome of genes relating to the lipid metabolism of the liver of periparturient dairy cows, 10 healthy Chinese Holstein cows were randomly divided into two groups and fed diets supplemented with 18.4 g/d RPN or 18.7 g/d RPM, respectively. The experiment lasted from 14 days before to 21 days after parturition. Liver biopsies were taken 21 days postpartum for transcriptomic sequencing. In addition, human LO2 cells were cultured in a medium containing 1.6 mmol/L of non-esterified fatty acids and 1 mmol/L niacin (NA) or 2 mmol/L nicotinamide (NAM) to verify the expression of the 10 genes selected from the transcriptomic analysis of the liver biopsies. The expression of a total of 9837 genes was detected in the liver biopsies, among which 1210 differentially expressed genes (DEGs) were identified, with 579 upregulated and 631 downregulated genes. These DEGs were associated mainly with lipid metabolism, oxidative stress, and some inflammatory pathways. Gene ontology (GO) enrichment analysis showed that 355 DEGs were enriched in 38 GO terms. The differences in the expression of these DEGs between RPN and RPM were predominantly related to the processes of steroid catabolism, steroid hydroxylase, monooxygenase activity, oxidoreductase activity, hemoglobin binding, and ferric iron binding, which are involved mainly in lipid anabolism and redox processes. The expressions of FADS2, SLC27A6, ARHGAP24, and THRSP in LO2 cells were significantly higher (p < 0.05) while the expressions of BCO2, MARS1, GARS1, S100A12, AGMO, and OSBPL11 were significantly lower (p < 0.05) on the NA treatment compared to the NAM treatment, indicating that NA played a role in liver metabolism by directly regulating fatty acid anabolism and transport, inflammatory factor expression, and oxidative stress; and NAM functioned more as a precursor of nicotinamide adenine dinucleotide (NAD, coenzyme I) and nicotinamide adenine dinucleotide phosphate (NADP, coenzyme II) to participate indirectly in biological processes such as ether lipid metabolism, cholesterol metabolism, energy metabolism, and other processes.