The reigning world champions were made to work after Yiannis Okkas opened the scoring in the 12th minute and Chrysostomos Michail extended Cyprus' advantage early in the second half.
Fiorentina frontman Gilardino, whose last-gasp equaliser against the Republic of Ireland on Saturday clinched top spot in Group Eight, produced the heroics to spare Italy an embarrassing result.
He reduced the deficit 12 minutes from time, adding the equaliser three minutes later, before scoring the winner in the dying seconds.
The result means Italy finished five points clear of second-placed Ireland, who were held to a goalless draw by Montenegro in Dublin.
Shay Given and Kevin Kilbane each completed a century of appearances for the Republic.
A sixth draw to go with their four wins ensured Giovanni Trapattoni's team will head into next month's play-off games without a defeat to their names so far.
Bulgaria trounced Georgia 6-2 in the other group match, with Dimitar Berbatov grabbing a hat-trick and Martin Petrov hitting a double for the home side in Sofia, who finished third in the group.