In case of 5
there is a lone pair with nitrogen atom which can help to reduce to positive charge and make double bond with a positive charge on nitrogen so we say this carbocation is extra stable due to its involvement in resonance . Though there is a -I of nh2 but resonance overpowers it
In case of 4
Br has a -I effect and also shows -M effect I.e helps ...