Fasting is integral to the life-history of many species. After abrupt weaning, Northern elephant seal pups (Mirounga angustirostris, NES) undergo fasting for approximately 60 days. During this period, bacterial diversity of the gut increases, likely reflecting changes in immune responses that facilitate establishment of commensal bacteria. We compared differentially-expressed genes (DEGs) in the enteric mucosa of female and male pups between early and late fasting. For this, total RNA was extracted from rectal swabs collected from NES pups born at the San Benito Archipelago (Mexico) in 2019. Using deep sequencing, the NES gut transcriptome was assembled and annotated, followed by differential expression and functional enrichment analyses to identify genes, pathways, and long non-coding RNAs (lncRNAs) possibly involved in regulating immune tolerance. A high-quality transcriptome was generated, and we defined the identity of protein-coding genes and candidate lncRNAs which were differentially expressed between weaning and fasting and between sexes. Sixty-eight genes were differentially transcribed during fasting. Upregulated genes were related to immune responses, protein synthesis and cellular housekeeping. Male pups had various upregulated genes compared to female pups, including those involved in immunomodulation and proteolysis. Xist, a lncRNA, was also downregulated in male pups. Distinct pathways related to immune system regulation, such as antigen processing and presentation of peptide antigen via MHC class II genes, were enriched during fasting. Ours is the first study of the NES gut transcriptome, and it has allowed the identification of genes that likely play a key role during early life stages of a phocid.