I can think of some ways to deal with S-400. These are my personal thoughts, none of them are actually proven against an actual S-400, so I will happily accept constructive criticism. Also, I am mostly reproducing already known techniques of dealing with a radar installation.
1. Use intelligence gathering to locate the radars and use special forces to take them out ahead of an air strike.
2. Use an E-Bomb in the vicinity. An E-Bomb produces very high powered microwaves that simply fry up the electronics.
3. Use HARM missiles. I don't know how effective these would be against an AESA radar, but it remains an option.
4. Saturation attack. Any radar has an upper limit. Pakistan will Insha Allah have a huge surplus of very hold aircrafts such as A-10s, F-7s, Mirages, K-8 etc. Make these autonomous/remote controlled and fly them in very high numbers. Include drones, and 'dummy missiles' which have no warheads.
5. Stealth technology. Yes, it is not foolproof, but it makes it that much harder for the S-400 to detect anything.
Some of these options are truly futuristic, but hey who said defending our airspace is going to be an easy job. We need to keep on our toes and keep researching new technologies.