The iconic exchange when Bilbo takes the cup is from Smaug's hoard (Chapter 12: "Inside Information"), not Gollum—Gollum has the Ring.
Bilbo: "I have taken the cup! I have won the game! I have beaten the dragon!"
Smaug (awakening): "Thief! Thief! Baggins! We hates it forever!"
Gollum: "My precious... it's mine, my own."
Bilbo: "What have I got in my pocket?" (winning riddle question)
Two distinct scenes: cup theft from the dragon; riddle game with the Ring's previous bearer. Both pivotal. Both frequently conflated.