A product of United's youth system, Gillespie rejoined his boyhood club from Scottish Premier League side Motherwell in July 2020 and has provided vital competition for the Magpies' goalkeepers since his return to Tyneside.
The 32-year-old has made three senior appearances for the club and was on the bench for 13 competitive fixtures during the 2023/24 season.
Gillespie said: "I'm delighted to be extending my contract into next season. This is the club I grew up supporting and it's a hugely exciting time to be a part of it.
"We have a brilliant group in the dressing room and at the training ground, and it's a great environment to work in. I'm already looking forward to pre-season and to getting back onto the grass."
Newcastle United head coach, Eddie Howe, said: "Mark's attitude to his work and his consistency are of the highest order.
"He continues to set an example in how he trains, plays and supports his teammates, and that's a hugely important component in any squad. I'm delighted to have him with us."