Reduce capital gains tax on a 2nd home sale

Can I use the closing costs I paid when I purchased the 2nd home  to offset the capital gains tax when I sold it 2 years later.   I know I can use the cost to sell tue home, but can I use the closing cost amount when I first purchased it to reduce my capital gains