Former Arsenal goalkeeper announced his international retirement in the summer but was given this, his 57th cap, as a farewell game.
He was in tears at the reception when he was substituted in the 58th minute.
Overall, it was a comfortable win for Poland in Warsaw’s Stadion Narodowy.
Karol Swiderski headed them into the lead before San Marino’s Cristian Brolli scored his fourth international own goal.
Tomasz Kedziora, Adam Buksa and Krzysztof Piatek increased Poland’s advantage.
Buksa slotted home their fourth to keep up his remarkable start for his country.
The 26-year-old New England Revolution striker has now scored five international goals in only 206 minutes across four qualifiers.
Robert Lewandowski played 65 minutes and had six shots without scoring.
The win keeps Poland in third place in Group I, five points behind England.