Answers
Yes of course you can do it in Greece, but it will be applicable according to Greek laws.
According to Greek Immigration Law, the third country nationals who buy a property with min. amount of 250.000 euros are entitled for the 5 years renewable permanent residence permit for property owners (Golden Visa) along with their family members. Family members are considered, among others, the spouse or partner with whom a third-country national has a cohabitation agreement in Greece. So the answer to your question is yes, since the cohabitation agreement was signed in Greece. Please ask about the prerequisites of the law regarding the cohabitation agreement in Greece.