To some extent, yes. As a matter of fact, as mentioned earlier, impotence is a post-testicular cause of male infertility. However, a man with the impotence problem can produce normal sperm and his sperm count be okay, and the same applies the other way round: it is not necessary for an infertile person to have erection problems.
Impotence can be cured with medications such as Viagra, but infertility might require the use of fertility treatments such as IVF or ICSI to produce offspring.
Suggested for you: What’s the Difference between Infertility, Sterility & Subfertility?.