B&W pirate movie with boy


I remember seeing a B&W movie in the late 60's on TV. I only remember the last few scenes.

I believe some pirates had captured an English ship. The English captain had his hands tied behind his back with rope and was held in a room aboard ship with an English boy. By the end of the movie, the English boy was friendly with both the English captain and the pirate captain.

The English captain asked the boy to cut his hands free using a knife (maybe the ship was in a battle with another English ship). Somehow the boy accidentally stabbed the English captain in the back with the knife killing him. The pirate came into the room just as that happened and saw what the boy had done.

The ship must have been captured and the dead captain found. Because the pirate didn't want to tell the truth and say the boy had killed the captain, he let the English sailors think he had killed him. The next scene had a narrator(or maybe the grown-up boy) saying the pirate had been hanged for the murder (there might have been a still scene of the gallows).

It's not:
Treasure Island 1934 or 1950
Captain Kidd 1945
The Boy and the Pirates 1960

A High Wind in Jamaica (1965) has a plot fairly similar to what you have described -- see the entry at Wikipedia (https://en.wikipedia.org/wiki/A_High..._Jamaica_(film)). The complete movie is on YouTube