Gosling had been widely expected to join Bournemouth after injury restricted the 24-year-old to just 36 appearances for Newcastle in four years at St James' Park.
He scored twice in 14 games on loan at Blackpool earlier this season and will now return to the Championship after accepting the move to Bournemouth.
The deal, which is subject to a medical, will officially go through on July 1st when the transfer window reopens, and Bournemouth boss Eddie Howe is delighted to have signed Gosling following interest from several clubs.
"We have been speaking with Dan and his representative for a while and were always very keen to bring him here," Howe told the Daily Echo.
"He did very well on loan at Blackpool and ended the season in the team at Newcastle. That Premier League experience will be invaluable to us and we are very pleased to have got him.
"He is a box-to-box central midfielder who has lots of energy. He is very good technically and also has a goal in him.
"He is an attack-minded player who can do all disciplines of the game so I think he will complement our team very well.
"He is very ambitious and a very dedicated professional and his aim is to get promoted with a Championship club.
"We had to fight off some competition to get him and it is always a good sign when other clubs are interested.
"We are delighted he chose us ahead of them and I think he was attracted by our style of play and our vision for him so, hopefully, it is a good match and we will both get when we are looking for from the signing."