A last minute stunner from Oxford gave the visitors all three points as the season came to an end at the Martin and Co Arena.
City substitute Felipe Barcelos acrobatically smashed home a bicycle kick in the 90th minute to keep their play off hopes alive, if only for a matter of minutes.
But there was controversy as there seemed to be a clear handball in the build up to the goal.
It was not what the Blues deserved as they had taken the game to a team who needed to win.
Following the 3-1 demolition of Stockport the week before, manager Steve Housham named an unchanged line up.
It was City who started at a furious pace with right-back Luke Coulson getting forward at will, delivering excellent crosses that were inches away from 25 goal man, Adi Yussuf.
Trinity always looked dangerous on the counter and they took the lead in the 16th minute as Simon Russell used quick feet to round the keeper and smash home, after Stephen Brogan had a shot cleared off the line.
It was a moment of quality from Russell, who became the first to reach double figures in a Trinity shirt this season.
City went quiet after the opener, as the Blues began to play some of the football that has seen them cruise away from the relegation zone.
Winger Jamie Yates clipped the crossbar with a deep cross, then the game became a story of bobbles, with promising runs from Chris Hamilton halted by the pitch.
Soon after the interval Brogan was affected, linking with Hamilton to get through on goal, but it was clear he had no confidence in the surface as he slowed his run and eventually fired a tame effort on goal.
The game turned midway through the half as Darren Pond equalised from four yards out as a cross somehow bobbled under the foot of Cliff Byrne.
Trinity had a chance to regain the lead when Paul Beesley was through one-one-one, but he tried to guide the effort through the legs of City keeper Salva De La Cruz who gathered.
That was the last chance of the game for Gainsborough as Barcelos’ stunner ended the Blues unbeaten run of five games.
After the game, Gainsborough boss Housham, was less than satisfied with the goal: “It’s a blatant handball for the winner. The referee’s not seen it and things went against us.”
“The lads are distraught because it was a handball.”
“I can’t fault the players as they really did put a shift in today and we was unfortunate to not get a point.”
“Everyone involved with the football club has done a fantastic job. A month ago we were in serious trouble and the lads have pulled together.”
“The fans have been fantastic too, both home and away, they have really helped get us over the line and we’ve been able to give them something to shout about in securing safety.”
Trinity: Watson (Budtz 90) Roma (c), Lacey, Binns, Byrne, Picton, Russell, Forrest (Beesley 67), Brogan, Hamilton, Yates (Stamp 75). Subs (not used): Davis, Davie.
City: De La Cruz, Coulson, Stonehouse, Del Alamo, Henderson, Santiago, Jackson, Fofana (Barcelos 70), Yussuf (Wilson 70), Balmy (Pond 56), Winters. Subs (not used): Scott, Mullings.
Goals: Russell 16; Pond 73, Barcelos 90.
Referee: Mr S Oldham. Assistants: Mr R Aspinall, Mr C Buxton.