Section 87A speaks about rebate in case where total income of an assessee is below Rs. 3.5 lakh he will get a rebate of Rs. 2500.
Therefore there is no limitation on type of income. In your case also the gain will be calculated and tax will be charges at 20% and then that tax will be reduced by 2,500 and you need to pay balance tax.
Hope you find the information helpful if you do please rate it 5 and provide your valuable feedback for my improvement.
Thank you.