Lewandowski opened the scoring for Poland from close range five minutes into the match at San Marino Stadium in Serravalle.
Striker Karol Świderski doubled the score in the 16th minute after being set up by Union Berlin left-back Tymoteusz Puchacz.
Lewandowski, the Polish goal machine, found the back of the net again from inside the box to put his team 3-0 ahead in the 21st minute.
Midfielder Karol Linetty added one more for the visitors in the 44th minute.
Nicola Nanni scored a consolation goal for San Marino three minutes into the second half after an error by the away team's defence.
Poland responded with a hat-trick by Buksa, who powered home a header in the 67th minute and then added two more goals in stoppage time.
After five rounds of fixtures, Poland consolidated its second place in its qualifying Group I, with 10 points and a plus-11 goal differential.
Poland are ranked 27th worldwide by football's governing body FIFA, while San Marino are next to last in the FIFA table, at No. 209.
The Poles, under their Portuguese manager Paulo Sousa, will now take on England in their next World Cup qualifying fixture in Warsaw on Wednesday.
The Polish national football team opened its 2022 World Cup qualifying campaign with a 3-3 away draw with Hungary in Budapest on March 25.
The Poles, captained by Lewandowski, FIFA's world player of the year for 2020, beat Andorra 3-0 in their second World Cup qualifier at home on March 28.
Poland lost 1-2 to England in their third 2022 World Cup qualifier in London on March 31.
Poland beat Albania 4-1 at the National Stadium in Warsaw in their fourth 2022 World Cup qualifier last Thursday, September 2.
The qualification stage for the 2022 World Cup runs until November 2021, while the tournament will be held in Qatar from November 21 to December 18, 2022.
(gs)
Source: TVP Sport, PAP