This depends on your leaving date. There are two possibilities:
1. You were on "gardening leave", and your actual leaving date was the date you were paid up to (it will be on your P45). In this case, the payment is taxable.
2. You did not work out your notice period. For example if your employer should (under your contract or under the law) have given you 4 weeks notice but instead told you to go without giving you any notice then you would be entitled to 4 weeks pilon and your leaving date on your P45 would be the date you actually left - i.e. 4 weeks before the date the pilon was paid up to. In this case, the pilon is not pay - it is compensation for breach of contract because the employer broke the contract by not paying you for the notice period. In this case, the pilon is not subject to tax or NI.