Mansfield Town will face Liverpool in the FA Cup third round after they overcame Lincoln City 2-1 at Field Mill.