Despite a slow start, Roberto Mancini's side went in at the interval two goals up courtesy of strikes from Federico Bernardeschi – the Juventus man's sixth international goal – and Gian Marco Ferrari.
Matteo Politano and Matteo Pessina added braces after the break, while Andrea Belotti was also on target as Italy brushed aside its neighbour with the minimum of fuss.
The result meant Italy stretched its unbeaten run to 26 matches, the second-longest run in its history after going 30 without defeat under Vittorio Pozzo between 1935 and 1939.
Italy struggled in the early stages against its less illustrious opponent, with only Gianluca Mancini and Bernardeschi registering efforts on target inside the opening half hour.
It went ahead after 31 minutes, however, when Bernardeschi's low strike from 20 yards proved too powerful for San Marino goalkeeper Elia Benedettini.
Sassuolo defender Ferrari, who scored on his only other appearance for Italy against San Marino in 2017, doubled the advantage three minutes later, volleying home after Benedettini had failed to clear a corner.
Half-time substitute Politano wasted little time making his mark on the game, sliding in his third international goal in the 49th minute after a mix-up in the San Marino defence.
Belotti added a fourth after 67 minutes, the Torino striker latching on to Bernardeschi's pass and firing past Benedettini from eight yards.
Pessina stroked home a fifth in the 75th minute after Gaetano Castrovilli had struck the post from outside the penalty area, while Politano added his second two minutes later with a fine volley from 12 yards.
Atalanta midfielder Pessina then rounded off the scoring four minutes from full-time with a poked finish from a tight angle.