Sex causing a yeasts infection ?

Me and my boyfriend had sex the other day and I had dried up after a while because we go at it for so long (sorry for the tmi lol) and I think because of the lack of lubricant my vag hurts and still hurts and I think it gave me a yeast infection😕

Im just asking can lack of lubricant during sex can give you an infection?