In Hemingway in Cuba, Hilary Hemingway and Carlene Brennen claim that this scene was inspired by an actual event from Hemingway's life in the 1930s when he hooked a huge marlin while on board his boat, the Pilar.
Ernest kept on pumping and reeling hard and fast. . . . He pulled back to pump the rod again and the marlin jumped three more times. Everyone on board was in awe at the way this giant rose up and hung in the air, its long, wet body blurring in great twists and bends, then crashing into a wave of white spray. The line sprang back like a banjo string and the beads of water fell from the line. The fish jumped again, this time hanging stiff and high in the air before falling.
Then the marlin tried to sound three times, and each time Papa* held him and brought him back to the surface. By now both man and fish were tired, but the fish had it worse by far. It seemed confused, and made several tight circles while Ernest took in line quickly. . . .
Just then, the great marlin came back to life with a burst of energy. Line screamed off the reel, and the fish came up closer to the port side and flung himself in a somersault of splashing spray. . . . Then straight back from the Pilar the big fish surfaced again, floating higher and resting, flipping its fins slowly above with the waves. The marlin was only a dozen yards away--it was the moment of surrender. . . .