Matthew 1:24-2524When Joseph woke from sleep, he did as the angel of the Lord commanded him: he took his wife, 25but knew her not until she had given birth to a son. And he called his name Jesus.
NOWHERE in this passage does Saint Matthew infer that Saint Joseph had relations with the Blessed Mother after our Lord was born. The point of this passage is to validate the Virgin Birth, the word "until" refers to the period of time BEFORE His Birth, not after.
And Luke, being the doctor, no doubt knew what the term *firstborn* meant since he didn't say she gave birth to her ONLY son.
Actually, Saint Luke knew that the term "firstborn" is an important LEGAL term in Jewish law that has NOTHING to do with medicine. The firstborn would be called the firstborn whether there were subsequent births or not. Do a search on the term "firstborn" in the Bible, it occurs nearly one hundred times in the Old Testament.