We investigated the longitudinal relationship between erectile dysfunction (ED) drug use with behavioral factors, including substance use and sexual activities in men who have sex with men from the Multicenter AIDS Cohort Study during 1998-2016 (n = 1636). We used a bivariate random-intercept model to evaluate ED drug use along with other behavioral factors to assess relationships between the two outcomes over time on a population level and also at the individual level. Average ED drug use among men who have sex with men (MSM) with HIV was positively correlated with average use of marijuana (r = .19), poppers (r = .27), and stimulants (r = .25). In this group, testosterone use (r = .32), multiple partners (r = .41), insertive anal intercourse with condom (r = .40), and insertive anal intercourse without condom (r = .43) all showed moderate correlations over time with average ED use (p < .001). Associations among MSM without HIV were similar, with average marijuana use (r = .19) and stimulant use (r = .22) being positively correlated with average ED drug use, and were also correlated with having multiple partners (r = .36), insertive anal intercourse with condom (r = .22), and insertive anal intercourse without condom (r = .18) over time. Positive within-individual associations between ED drug use and multiple partners and insertive anal intercourse with and without condom were observed regardless of HIV serostatus. This study showed that MSM who reported use of ED drugs were also, on average, more likely to use recreational drugs and engage in sexual activities, such as having multiple partners and insertive anal intercourse. Within individuals, average ED drug use was also positively correlated with sexual behaviors.