The 28-year-old Newcastle supporter was born in the city and started his career with the Magpies at academy level before moving to Carlisle United in 2008 aged 16.
He played 180 games for the Cumbrians before joining Walsall in 2017 and Scottish Premiership side Motherwell in 2018 where he became first-choice, helping them finish third last season.
Bruce said: "We're very pleased to welcome Mark aboard. He was here when he was young and has gone on to do very well. He'll give us really healthy competition with our goalkeepers and we wish him the very best of luck."
Premier League
Guardiola suggests Torres could fill striker role for City
Gillespie, a free agent after his contract at Motherwell expired, will back up first-choice keeper Martin Dubravka and Karl Darlow after long-serving Rob Elliot left the club.
"It's an unbelievable feeling for me to sign for Newcastle," he was quoted as saying on the Newcastle website
"Being a supporter all my life and to be released at 16 was disappointing, but I have gone away, worked hard and now I'm back, and I can't wait to make the most of an opportunity every Geordie would dream of." (Wrditing by Ken Ferris; Editing by Pritha Sarkar)
Barcelona ready to prioritise Haaland ahead of Messi - Paper Round
Chelsea's Kirby named FWA Women's Footballer of the Year