Kamil Grosicki broke the deadlock just 10 minutes into the match, gathering the ball from a cleared corner before powering it home from 25 yards out.
Gibraltar, who were playing a competitive international for the first time, defended well for the remainder of the first half though, with Jordan Perez making a couple of saves before Rafael Bado and Brian Perez had chances to get the hosts back on level terms.
Poland upped their game in the second half though, resulting in a second for Grosicki within three minutes of the restart.
Lewandowski added to the scoreline, heading in from close range to put the visitors three goals up, before drilling the ball in from 18 yards out three minutes later.
Poland continued to apply the pressure, with Mateusz Klich continually getting the better of the Gibraltar defenders to send in a string of crosses, eventually resulting in an easy header for Lukas Szukala.
Lewandowski completed his hat-trick shortly before full time, drilling the ball into the bottom corner inside the final five minutes, before scoring from a similar position in stoppage time to complete an emphatic win for Poland.