IF the sorceress was replaced with a male magic-user for the gamebook, then I think the novel was Firestorm, book 1 of a 4-part series called "The Zagor Chronicles". The first two books in the series were published in 1993, and the second two in 1994, so the dates are consistent with you finding them in the late 90s.
That would mean that the gamebook was Legend of Zagor, published in 1993. It was a very late entry in the Fighting Fantasy series of gamebooks.
The "castle or tower" you remember them fighting their way through was called "Castle Argent" and the picture at the wiki link shows it to be primarily composed of a large tower.
According to the Fighting Fantasy wiki, the warrior, Braxus meets the sorceress, Jallarial early in book 1, and they travel together. The wiki doesn't have a page for Jallarial, annoyingly, so I'm working with incomplete information here.
The other two characters in the gamebook were Anvar the Barbarian and Stubble the Dwarf, who also has no wiki page dedicated to him. Stubble and Anvar also featured in the novels, and if I understand Anvar's wiki entry correctly, they meet up early on in Firestorm but don't encounter Braxus and Jallarial until later in the book.
If this is the correct answer, then I should note that although the four main characters work as a team in the novels, only one of them enters Castle Argent in the gamebook (You choose which one.) Also, Jallarial is replaced with a male wizard, her brother Sallazar.
The gamebook was indeed set after the novel. Remember, Firestorm was book 1 in the series. Book 2, Darkthrone, was an alternate version of the gamebook's story.
I did read some of the Zagor Chronicles, but I wasn't really a fan, so I'm afraid I've forgotten quite a bit of this. I loved the Fighting Fantasy gamebooks, but the novelisations never did much for me. I can say that I don't remember the novels having illustrations, but I know the gamebook did have some.
There's a very interesting Amazon review of Firestorm at this link.
The fact that you found these books on the same shelf as The Adventures of Goldhawk is no surprise. Goldhawk was a spin-off of the Fighting Fantasy series, targeted at younger readers - which would explain why it was so much shorter than Legend of Zagor! The FF wiki doesn't have much on Goldhawk, but see this page. Even more relevant to the library shelf:
- The Goldhawk books were written by Ian Livingstone.
- The Zagor Chronicles were written by Ian Livingstone and Carl Sargent (aka Keith Martin).
- The cover of Legend of Zagor credited Ian Livingstone as the author, even though it was written by Carl Sargent.
So all of these books would have been in the same location under 'L' on an alpabetically-ordered library shelf!