Five people who were stranded on a rock after their boat broke anchor have been rescued after emergency crews spotted their SOS message written on a sandbank.

Queensland water police discovered a six-metre boat adrift with nobody onboard near Brampton Island, about 30 kilometres north-east of Mackay, off north Queensland early on Monday afternoon.

After searching the area for several hours to no avail, a rescue helicopter was called to help find the boat's occupants.

Rescuers spotted an SOS message written in the sand at nearby Wigton Island about 5:30pm (AEST) and soon after found five people on a nearby rocky outcrop.

The three men and two women had gone ashore on the rocky outcrop, but their boat drifted away, leaving them stranded.

All five were winched to safety after spending about nine hours stranded on the rock.

The five have spoken of their relief at being found.

Craig Gilbert says they were overjoyed at spotting the rescue helicopter.

"We saw the helicopter and we thought 'oh, you beauty' and then it disappeared and we thought, 'Oh no - we better look out for our beds for the night' - then it came back probably 20 minutes later," he said.

Rescue helicopter crewman Damien Kross says the five were treated for sunburn and dehydration.

"They were fine - they weren't injured," he said.

"They were a little bit dehydrated but we winched them to safety and brought them back here for just to have a quick medical attention and they were all fine."