The 56-year-old woman married her husband in November 2007, when he had terminal throat cancer. He died three weeks later.
The insurance company denied the woman the pension because she could not disprove that the marriage had been made for the sake of maintenance.
The woman, who lives on state benefits, argued to the court in the western town of Darmstadt, that she did not know how long her 58-year-old husband had to live at the time of their marriage.
Under German law, widows or widowers from marriages that last less than a year are not entitled to a widow's pension, though exceptions are made for accidental deaths or deaths by an unforeseen illness.
In this case, the judge decided that the man's illness was terminal at the time of the marriage and that the couple knew this.