The 29-year-old Bayern Munich star started the game with 47 international goals, one behind the record of 48 held since 1980 by Wlodzimierz Lubanski.
Kamil Grosicki scored Poland's opener after just two minutes at the Hanrapetakan Stadium in Yerevan with a near-post finish from Lukasz Piszczek's cross.
Fifteen minutes later Lewandowski curled in a free-kick to make it 2-0 and draw level with Lubanski.
Lewandowski claimed the record when he blasted home an indirect free-kick on 25 minutes and he completed his treble in the second half to make it 50 goals in 90 appearances. Jakub Blaszczykowski and Rafal Wolski were also on the scoresheet for Poland.
Lubanski, who played for the majority of his career at Górnik Zabrze in Poland and Lokeren in Belgium, set his tally in 75 internationals between 1963 and 1980.
Poland require just a point from their final qualifier at home to Montenegro on Sunday to clinch their place in the finals.