If you join while the startup is in the YC Founders Program [1], you're pretty much a cofounder, even if you have less equity than other employees. In that case, yes, you get to go to the dinners.
1. The Founders Program is the 3 month program that YC runs.