Let's assume that the doctor has scheduled the C-section for a date that he or she assumes is very near to the child's full-term due date. (I.e., that the C-section wasn't scheduled for the convenience of the doctor, but for the full development of the baby.)
If March 21 is considered the child's full-term due date, the conception date associated with that due date is June 28. If her cycles are on the average 28 days from period to period, she would be expected to have had a period before that around June 14. That would suggest sex on May 26 is too early to have produced the pregnancy. The baby would have to have been conceived in June, (or the due date given to her would have to be in February) for the last date the guy remembers having sex to be the right date for conception.
This doesn't rule out mistakes in figuring this out, however. Women mis-hear their doctor about due dates sometimes, or the guy mis-remembers what that date was, or that time they had sex later than the date he is sure was the last time has slipped his mind, or he is hiding it from his current girlfriend. But if all the facts are as you outlined them, it does make it valid and logical for him to request a DNA test.
Because this becomes a legal matter when someone has divorced and is now being told he is the father of a baby, your friend and his ex should not fool around with things like home DNA tests later to work this out. He should speak to the clerk of the family court in his area of jurisdiction, and get information on how to do a legally admissible DNA paternity test, and follow those instructions. The test can be done at the hospital when the baby is born.
If they are an amicable pair of exes, and if they both want to know for sure while she is still pregnant, they can spend the big bucks and go to Ravgen or the DDC for a prenatal DNA test. It's done with a blood draw from the mom (her arm) and a swab from the guy(s), and it can tell them right away if he is the dad. If the other guy gets swabbed too (a very good idea), it will give one of the men a 'yes' and the other a 'no,' which is useful because each test result will affirm the other's. (This is a good idea to do when testing after the baby is born, too, for the same reason. One is ruled out and the other is ruled in.) I think the price of prenatal testing is about ten times as much as waiting until the baby comes, so people sometimes don't do it for that reason but just test at the hospital when the baby is born. And I don't think (unless this has changed) prenatal tests are admissible as legal evidence of paternity, so one will be required when the baby arrives anyway. But if they want to know now and it's worth the money to them, they can do a prenatal test and everyone can go about their life, only confirming later when the baby comes with a legally admissible test.