The Necromancer is indeed Sauron himself, but from what I gather, he was never mentioned by name in The Hobbit.
In chapter seven of the book — “Queer Lodgings” — Gandalf is about to leave the party, and explains the route the rest must take. When Bilbo inquires if there was some safer indirect way, Gandalf says “There are no safe paths in this part of the world”, and proceeds to enumerate the dangers, one of which being the Necromancer:
Before you could get round it [Mirkwood] in the South, you would get into the land of the Necromancer; and even you, Bilbo, won’t need me to tell you tales of that black sorcerer. I don’t advise you to go anywhere near the places overlooked by his dark tower!
In The Hobbit edition annotated by Douglas A. Andersen there is a respective note on page 188:
The reintroduction of the Necromancer here was originally quite casual; his function, as Tolkien wrote in a letter to Christopher Bretherton on July 16, 1964, was “hardly more than to provide a reason for Gandalf going away and leaving Bilbo and the Dwarves to fend for themselves, which was necessary for the tale”.
And on page 57 (chapter one), in the note about Thorin’s father being imprisoned by the Necromancer:
In The Lord of the Rings, we learn that the Necromancer of The Hobbit is also the Dark Lord, or Sauron…
Thus, in the book, the Necromancer is mentioned grand total of two times, and the name Sauron never appears. I suppose, for the film adaptation they deliberately made it more obvious to better connect with the subsequent trilogy for those who are not well versed in the LotR universe, including myself. Ironically, I had missed that connection in the film (going to have to pay attention when I re-watch it), and only caught on to this, because of the marvelous book I have.