Can I include the recapture fee paid to municipality as seller cost in the calculation of capital gains on the sale of an affordable housing unit?

Unit was sold for $169,900 (FMV). The maximum resale price is $102,364 (MRP) according to the municipality. Recapture fee of $53,965.20 was paid to municipality based on the above. I do not think I should include the recapture fee as part of the capital gains since it went to my municipality.