I’m from Portugal and my name was drawn in this year’s visa lottery. My girlfriend and I have become quite serious and are talking about marriage. (Same-sex marriage is legal here.) I’ve read that spouses can accompany DV lottery winners, but we’re not yet married. Is it too late to get married and have my new wife get a green card along with me and come to the United States together?
No, it’s not too late at all – assuming you can get married before your visa interview.
First off, you are correct that spouses, including same-sex ones, can accompany the winner of a diversity visa lottery to the United States, on a “derivative” visa. This began with Diversity Visa Program ("DV-2015"), so by now there should be no confusion that same-sex couples qualify as derivatives on visa applications.
(The State Department instructions for DV-2014 and previous years stated otherwise, since the U.S. Supreme Court's decision clearing the way for same-sex couples to obtain U.S. immigration benefits had not yet been announced. Also, some U.S. government officials were giving inaccurate information to visa applicants long after they should have. However, the law has changed, and a same-sex spouse can now claim the same immigration benefits as an opposite-sex spouse.)
Second, you don’t have to have been married on the day of your lottery “win” to claim your same-sex spouse as a derivative. You must have been married in a state or country that legally recognizes same-sex marriage.
The key will be that you are married before your immigrant visa or adjustment of status interview, indicate the appropriate information on the paperwork you fill out for that interview (you may need to amend what you've already submitted), and make clear that this isn’t a marriage of convenience to get your new spouse a green card. You may need to provide not only a marriage certificate, but documentation of your relationship and that you are planning to create a shared life together.
Be sure to act quickly no matter what you decide, however. You will need to obtain your diversity-based visa by the end of the fiscal year in which your name was drawn, or lose your chance at it, as discussed in Nolo's articles on diversity visas and green cards.