It is quite possible for sperm from 08/02 to fertilize an egg at ovulation 08/05. You should do a test on A to confirm he is the lucky guy and there was no mistake on the first NIPP test. Best of luck!
As ppowb points out, if you did ovulate on the 5th of the month, it does not rule out the possibility that sex on the 2nd of the month produced the pregnancy. The 2nd is not far enough ahead of the presumed ovulation date for all the sperm to be dead by the 5th. ("Pulling out" doesn't actually do much to prevent pregnancy; he could have had sperm in his pre-ejaculatory fluid.)
How did you get the ovulation dates, from an app? (You weren't by any chance using an ovulation predictor kit at the time?) And are your menstrual months super regular and always 28 days from period to period? Sometimes a woman gets her ovulation date from an app, but it is not based on her own cycle history but is based on lots of women's average cycle length, which might be not the same length as the woman's own cycle. This could explain the negative test of the guy you think should be the father -- he might not have really been on the exact right day even if the app makes it look like he was.
What company did your prenatal DNA test?
Did you witness the guy doing the swab and handing it to the lab technician? If you didn't, and if he has seemed to resist the idea that the pregnancy is from him all along, that could be a place in the chain of events to reconsider. (It's possible to get a negative on a DNA test by sending a lookalike buddy in with your own ID.)
It's never a bad idea to test both guys when doing prenatal DNA tests (or post-natal ones either, for that matter). One guy will get a positive and the other will get a negative, and each guy's test will act to fact-check the other's.