Capital gains question

I inherited a home that I am now selling. I believe I will net $170k or so from the sale.

Coincidentally, our primary home has a mortgage payoff of $170k.

Can I use the gains from the sale of the rental to pay off the loan on the primary home to avoid capital gains?