Hi Manish,
Hope you are doing well !!
Yes, you can deduct the amount paid to ex employer.
Section 15 of the IT act deals with the asked scenario.
The notice pay deducted by the first company need not be shown as salary income earned from the first company. The notice pay received from the second company need be shown as salary income earned from the second company. Section 15 says the salary income is taxable on Receipt or Accrual basis whichever is earlier but the salary can be taxed only on one basis. Thus the salary earned in the second company can be offered on receipt basis and the deducted notice pay in the first company shall not be offered as salary on receipt basis.
We may assist you in ITR filing.