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, refer to IRS Publication 527 under the subheading Basis of Depreciable Property.