Only loan interest and real estate taxes are deductible closing costs for a rental property.
Other settlement fees and closing costs for buying the property become additions to your basis in the property. These include abstract fees, charges for installing utility services, legal fees, recording fees, surveys, transfer taxes, title insurance, and any amounts the seller owes that you agree to pay (back taxes or interest, recording or mortgage fees, charges for improvements or repairs, and sales commissions).
Costs that are basis adjustments can be part of your yearly depreciation deduction for the rental property.
There are also several closing costs that can’t be deducted and aren’t added to basis. For this list, see the Basis of Depreciable Property subject in IRS Publication 527 Residential Rental Property (Including Rental of Vacation Homes), on page 7.
Note that any link in the information above is updated each year automatically and will take you to the most recent version of the document at the time it is accessed.