The antibiotic, trimethoprim-sulfamethoxazole (TMP-SMX), is generally used for prophylaxis in HIV individuals to protect them from Pneumocystis jiroveci infection. Long-term use of TMP-SMX develops drug resistance among bacteria in HIV patients. The study was aimed to detect the TMP-SMX resistance genes among gram-negative bacteria from HIV patients. TMP-SMX-resistant isolates were detected by the Kirby-Bauer disc diffusion method. While TMP resistance genes such as dfrA1, dfrA5, dfrA7, and dfrA17 and SMX resistance genes such as sul1 and sul2 were detected by multiplex PCR, class 1 and class 2 integrons were detected by standard monoplex PCR. Of the 151 TMP-SMX-resistant bacterial isolates, 3 were positive for sul1 alone, 48 for sul2 alone, 11 for dfrA7 alone, 21 for sul1 and sul2, 1 for sul1 and dfrA7, 23 for sul2 and dfrA7, 2 for sul2 and dfrA5, 41 for sul1, sul2, and dfrA7, and 1 for sul2, dfrA5, and dfrA7. Of 60 TMP-SMX-resistant isolates positive for integrons, 44 had class 1 and 16 had class 2 integrons. It was found that the prevalence of sul genes (n = 202; p < 0.001) was higher compared with dfr genes (n = 80; p < 0.001), and 87.4% (n = 132; p < 0.001) of TMP-SMX-resistant isolates also were positive for β-lactamase production. This type of study is reported for the first time from HIV patients in India. Therefore, this study indicates that dissemination of TMP-SMX resistance genes and class 1 and class 2 integrons along with β-lactamase production among gram-negative bacteria in HIV patients will certainly make their treatment to bacterial infections more complicated in clinical settings.