At first glance, sentence 1 below seems more correct because there are two subjects. However, something seems more natural about sentence 2. Maybe there is something abbreviated, elliptical, or adverbial in sentence 2.
In sentences of this structure, should the verb be singular or plural?
Not only a book, but also a pencil are on the table
Not only a book, but also a pencil is on the table.
The correct word should be is.
You wouldn’t normally say “a book are on the table” or “a pencil are on the table”. Since you did not make a list of nouns or use any plural nouns, the verb should remain singular.