Start with the assumption that everybody knows their own spouses -- which means that everybody there knew at least one person. Discounting yourself, everyone knows a different number of people, which means that (again, discounting yourself) one person knows one, one person knows two, one person knows three, etc., up to one person who knows nine people (everybody else). Number the people (besides yourself) according to how many people they know, so that person 1 is the one who knows one person, person 2 is the one who knows two people, etc.
Now pair up people with their spouses. If person 9 knows everybody else, s/he must be the only person who knows person 1, because person 1 only knows one person. So they must be married. Person 8 knows everybody except for person 1. Person 2 therefore knows person 8 and person 9. Person 9 is married to person 1, so person 2's spouse must be person 8. Person 7 knows everybody except for persons 1 and 2. Person 3 therefore knows persons 7, 8, and 9. Persons 8 and 9 are married to persons 2 and 1 respectively, so person 3's spouse must be person 7. Person 6 knows everybody except for persons 1, 2, and 3. Person 4 therefore knows persons 6, 7, 8, and 9. The only one of those not yet paired up is person 6, so person 4 and person 6 must be married.
This leaves person 5, who knows everyone except persons 1, 2, 3, and 4. These five people, therefore, must be persons 6, 7, 8, 9, and you. Since you are the only one of these five not yet paired up, person 5 must be your spouse. So your spouse knew five people prior to the party.
The above also determines that the people who know you are persons 5, 6, 7, 8, and 9. So you knew five people prior to the party also.
Today's quiz courtesy of Braingle.com.