Igla can reach a little bit higher, especially considering the ground elevation. At the end of its trajectory it's moving at supersonic speed, so even small variations in starting conditions result in a wildly varying range. The hard limit is self-destruction timer linked to exhaustion of its internal gas generator charge or to boil-off of liquid nitrogen in optical tracking sensors.
It's also possible to get additional 100-200 meters of elevation if it's shot towards the approaching plane (it's tricky to get a lock in such conditions, but possible). And lastly, the rocket itself detonates within 40 meters from the plane to maximize the damage, so it's possible to get a little more altitude from that.
Hitting a target at 5km requires specialized MANPADs (like Grom missiles), I don't know if Ukrainian army had them.