Relegated Albion had looked set to bid farewell to bid farewell to the Premiership when two goals from Scott Dobie cancelled out a Jermaine Jenas opener for Newcastle in the first half.
Albion gave a sentimental outing to veteran striker Bob Taylor, who was making his final appearance for the club before being released in the summer.
It was Taylor's first start since the end of September, but it proved an unhappy end for the 36-year-old who limped off after just 30 minutes, to be replaced by Dobie.
Before his abrupt departure, Albion should have stunned high-flying Newcastle by taking a 22nd minute lead, but Andy Johnson squandered a golden chance when he lifted the ball over the bar from just 12 yards after a neat through ball from Derek McInnes.
Lomana LuaLua and Shola Ameobi were a constant threat and the only surprise was that they were not involved when Newcastle made their breakthrough two minutes before half time.
Newcastle forced two corners in quick succession and from the second, Jenas headed home Nolberto Solano's cross from ten yards.
LuaLua then threatened to increase Newcastle's advantage almost immediately only to be denied by a smart near-post save from Russell Hoult.
Albion were also forced to ride their luck again immediately after half time when Ameobi crashed a close-range header off the bar.
Ameobi's personal frustration continued in the 51st minute when he waltzed around Hoult only to see his shot cleared off the line by James Chambers.
They were to prove to be crucial misses as Albion suddenly found a way through the Newcastle defence and gave a sign of what was to come after 54 minutes.
Danny Dichio was sent clear by Johnson and only had Shay Given to beat, but the Republic of Ireland international spread himself well to beat away the shot.
But Given was powerless to prevent Albion capping their best spell of the game with Dobie's 57th minute equaliser.
A long through ball from McInnes caught the Newcastle defence flat-footed and Dobie took full advantage to beat the offside trap and drill a low drive beyond Given.
Albion were different side after the goal and Dobie struck again 18 minutes from time.
Jason Koumas rolled a pass into the path of Johnson and when the loose ball ran to Dobie he calmly slotted a shot past the bemused Given.
His strike looked set to be good enough to earn Albion only their seventh win of the season, even after LuaLua missed a sitter in the 75th minute.
But Albion were undone by a brilliant piece of skill from Viana who curled his 20-yard free-kick around the Albion wall and beyond the outstretched hand of Hoult.