I do not think it is to replace F-16 A/Bs, at-least not when it will be inducted.
Now about why to limit to 5th-gen, you can differ with PAF opinion, but they would have looked at all options, compared 5th gen with so called 4.5 gen, their current schedule for block 3 and its comparison to 4.5 gen. AND also have looked at how they can go with four files in arms for funds, including a B, a block 3, than a 5th gen, and than also funding for a NGF project. And than after agreement from other side (saying light heartedly) suddenly slipped out of another side a funding request for a 4.5 gen, and while the other side would have looked incredulously at them, explained that guys on PDF are very worried about '2-3 years' gap so we must spend 3-4 bn $ on a 4.5 gen jet which will fly for next 20-25 year, and may have asked for two as (unfortunately for PAF) PDF members are still not in consensus to go for EF or Rafale
ohh, I forgot J-10, ahh well, J-11/J16 as well, my apologies