If you were to get a Urinary Tract Infection after using a spermicidal condom could the lab determine if you've had sex or not from your urine sample?

There would be no reason for a lab to test for whether or not you recently had sex. There is no diagnostic reason to ask that question in the lab setting and no test specifically designed to test for sexual conduct. However, there are urine tests that can detect gonorrhea or chlamydia; a positive test for either disease or a few others is a pretty good indicator that sex occurred - but if you properly used the condom, it's almost impossible to transmit/receive those kind diseases in the genitourinary tract. I'm re-reading the question over and over and I wonder if the real issue is that you don't want it to be known that you had sex. If that is the case, you should be OK - UTIs occur even in the absence of sexual activity.