Same-sex couples who live in states that don’t recognize gay marriage or civil unions are out of luck when it comes to estate taxes, facing much higher rates when one partner passes away than do their peers who are legally married.

The discriminatory nature of tax laws was illustrated by a recent case in Pennsylvania, where Marie Himmelberger’s longtime partner Sharon Warnock passed away in 2010. Himmelberger and Warnock were in fact legally joined in New Jersey after a 2007 civil union. However, Warnock was a resident of Pennsylvania, which didn’t recognize her union, nor any other legal representation of a same-sex relationship.

A Pennsylvania court last month ruled that the assets Warnock left to her partner would be subject to the state’s estate tax, which takes a 15 percent cut of an inheritance left to non-relatives. Had the pair been married, the tax would have been zero. Had they lived in New Jersey where their union was recognized, it would have been zero. However, since Pennsylvania officially does not recognize LGBT couples, Himmelberger was out $90,000.

Despite the roadblocks set up by the law, couples can still avoid a huge tax hit through some prudent financial planning and consultation with a good attorney. “Particularly in Pennsylvania, [same-sex couples] really do need to make sure that they come in, get wills established and take care of the planning,” says Paul Cohen, an attorney who works in estate planning in both Pennsylvania and New Jersey.

The inheritance tax can be particularly problematic for couples who share ownership of a house. Half of the house would be considered an asset of the decreased partner, and the remaining partner would have to shell out 15 percent of half the house’s value in cash, which could necessitate the sale of the house if there aren’t a lot of liquid assets available.

A federal 35 percent estate tax also kicks in on inheritance money that surpasses $5 million. Again, spouses are exempt from the tax, but the federal government does not recognize LGBT marriages because of the 1995 Defense of Marriage Act (DOMA).

Protect Your Inheritance

Cohen lays out some advice he gives to unmarried couples who want to avoid taking the full brunt of Pennsylvania’s estate tax, but these recommendations apply to other jurisdictions as well:

Life insurance: Life insurance isn’t taxed, so it can be wise to load up and protect the money from the state revenue department – and the payout can be used to pay the taxes on other assets, like a house.

Transfer assets before death: “If you have an older partner and a younger partner and all of the assets are in older partner’s name, one of the things you might want to start doing is transferring assets to the younger partner,” Cohen says. “It’s called equalizing the estate. Sort of hedging the bet on who’s going to die first.” Older partners can also transfer their assets to irrevocable trusts, which can still benefit the other partner but avoid tax consequences.

Leave it to the children: The Pennsylvania tax rate on inheritance left to children is 4.5 percent. If one of the partners has a kid, they can avoid the 15 percent rate and keep more money in the family by leaving money directly to the child. “Assuming that the surviving partner is financially independent, you might want to simply bypass the partner,” Cohen says.

Considering the amount of money at stake, Cohen has one more piece of advice he offers same-sex couples living in Pennsylvania: “Consider moving to New Jersey,” he says. “I would be remiss not to mention it to every client that’s in that situation.”

Finally, Cohen points out, the estate tax doesn’t just hit LGBT couples who can’t get married – it also effects any pair of people who are financially bound but unwilling or unable to get married. “It’s not just same-sex couples,” the attorney says. “It applies to opposite-sex couples who are not married for any reason. It applies to two elderly sisters who have lived together for 40 years. It applies to a lot of different situations where this tax really works to penalize people. It’s a problem.”