Historically, Pakistan has always been superior / peer / near-peer. In 1971, Pakistan had a lot of stuff which were technologically superior to India. However, we have always prevailed with better training and competent military leadership. Even this time, we spanked Pak black and blue. I agree that the 5th gen thing will be a source of trouble, but, that's not the biggest concern. Even if we beg, borrow or steal and get into a position where Pak is way below us technologically, it will still not solve the core problem - the handling of external countries and narrative during a conflict. Pakistan is an existential problem for us and it it on us to solve it. Russia was against the entire world when it started the fight against Ukraine - it did not give in.
Indian leadership is inherently weak when it comes to being bossed around by US - this is something which has to change, only then will any tech improvements in our military be of any use, otherwise, you can have the best weapons and training but without the will and strength of the leader, it's useless as has been proven again this time.
I am really sorry, but we just let Pak off the hook - we could have ensured that Pak's Navy and Airforce capabilities are degraded beyond repair this time and set an example of what will happen if and when the next Pahelgam happens. That would have been the strongest deterrence against future Pak sponsored terror. The would have known that without their navy (already non-existent) and Airforce, they will be sitting ducks waiting to be blown out of the water.