The match was invented after the lighter. Johann Wolfgang Döbereiner, a German chemist, invented the first lighter in 1823.
His device was often referred to as “Döbereiner’s lamp.” While various forms of matches have been around since ancient times, the first successful friction match (such as the ones we use today) was not invented in 1826 by English chemist John Walker.