Rituximab is associated with a higher incidence of Pneumocystis jirovecii pneumonia infection. Pneumocystis prophylaxis is advised in many immunocompromised populations treated with rituximab. However, the beneficial effect of pneumocystis prophylaxis in HIV-uninfected, rituximab-treated non-Hodgkin lymphoma (NHL) patients has not been assessed. Thus, we conducted this retrospective study to explore pneumocystis infection in HIV-uninfected NHL patients who received at least three courses of chemotherapy without haematopoietic stem cell transplantation using the Taiwan National Health Insurance Research Database. Patients who had rituximab-based chemotherapy were included in the experimental (rituximab) group, while the rest of the patients who did not receive any rituximab-based chemotherapy throughout the study period formed the control group. The prevalence rate of pneumocystis infection in the rituximab group (N = 7,554) was significantly higher than that in the control group (N = 4,604) (2.95% vs. 1.32%). The onset of pneumocystis infection occurred between 6 and 16 weeks after chemotherapy. Patients who had pneumocystis prophylaxis, whether or not they had a pneumocystis infection later in their treatment course, had significantly better first-year survival rates (73% vs. 38%). Regular pneumocystis prophylaxis should be considered in this group of patients.