The result has moved Northern Ireland onto four points in Group C ahead of their trip to the world champions Germany on Tuesday night.
It took 26 minutes for the home side to make the breakthrough, with Steven Davis converting from the penalty spot, but it was a tough slog for Michael O'Neill's side until the 50th minute, when San Marino's Mirko Palazzi was given his marching orders following a second yellow card.
Northern Ireland were always comfortable from that moment, however, and scored their second of the match in the 79th minute when Lafferty guided a Shane Ferguson cross into the back of the net.
Jamie Ward made it 3-0 in the 85th minute when the forward converted from close range after another dangerous cross from Ferguson, before Lafferty notched his second late on after brilliant work from the skipper Davis.
San Marino goalkeeper Aldo Simoncini was the star of the show, however, with the stopper preventing the visitors, who have still only ever won one match, from losing by more goals in Belfast.