Gosling's contract with Everton expired on 30 June and was in negotiations with the club in May regarding a contract extension - however, no deal had been agreed.
A Premier League tribunal came to the verdict that Gosling would be allowed to leave the club under the Bosman ruling, with no compensation paid by the club that would eventually sign the midfielder, who can operate in the centre as well as on the right.
According to the ruling, had Everton submitted a written offer of a new contract rather than a verbal one before the May deadline then the club would have been entitled to compensation - believe to be about £4m - because Gosling is under the age of 24.
Newcastle manager Chris Hughton revealed he was delighted to captured a "high-energy player".
"We are delighted to have signed Dan. He's the right age and the profile that he has is what makes it such an appealing capture for us," he said.
"He's young, but has Premier League experience and he's someone who can continue to develop his game.
"We see him as a high-energy player and a player that can play from box to box, but he's also a young player with experience, so he won't be phased by what is ahead of him."
Gosling could miss the start of the Magpies' campaign because he is recovering from a serious knee injury he sustained in March in an accidental clash with keeper Marcus Hahnemann during Everton's match with Wolves.
Gosling made 22 appearances for the Toffees after joining in January 2008.
His most celebrated moment in an Everton shirt came in February 2009 when he scored a dramatic late winner against Liverpool in the FA Cup.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.