Goals from Adi Yussuf and Javier Rodriguez gave Oxford City their first home league win and stretched Trinity’s winless run to three games, writes Matthew Bruce.
City were coming off a 7-2 thrashing of the Blues’ county rivals Boston United, and looked to pick up where they left off with two great chances inside 120 seconds of play.
Yussuf hooked a shot narrowly over on the turn and new signing Claudio Hoban almost opened his account for the club, heading a Paul Stonehouse cross just wide of the far post.
But it was top-scorer Yussuf who deservedly put City ahead after 12 minutes with an exceptional individual effort, driving through several challenges before shooting into the bottom corner.
Alejandro-Adrian Santiago spurned a golden chance to double the lead when he was granted a free header from a corner, but his effort went wide.
And Gainsborough could have equalised shortly before the break, City keeper Mark Scott doing well to keep out a close-range header effort from Paul Beesley.
After the break, City had several chances to kill the game off, but were let down by their final touch.
Yussuf missed several chances to net his second, firing into the side netting shortly after the restart following an excellent one-two with Rodriguez.
The visitors pressed forward, but while they were unable to carve out many openings they were vulnerable on the counter-attack.
Substitute Tom Winters was the beneficiary of one such break, striking the bar with his attempted lob.
Yussuf was also denied by the woodwork when he broke free of the Trinity backline, beating goalkeeper Jan Budtz with his strike, but not the upright.
But as the match entered stoppage time, City finally made the points safe, Yussuf linking up well with Rodriguez again, laying it off for the Spaniard to expertly round the keeper and fire home.
Oxford City: Scott, Benjamin (Wilson 57), Stonehouse, Pond, Lapoujade, Santiago, Hoban (Winters 52), Mullings, Yussuf, Rodriguez, Isaac (Barcelos 64). Subs not used: Green, Del Alamo.
Gainsborough Trinity: Budtz, Roma, Lacey, Binns, Quinn (Salt), Picton, Russell, Toner (Roberts), Beesely, Bateson, Davis (Stamp). Not used: Higginson, Lobjoit.
Liam Davis and a number of his Trinity team-mates wore special rainbow laces in their football boots on Saturday.
Davis, who spoke to the media about life as an openly gay footballer for the first time in January this year, and several other players were supporting a Stonewall campaign to raise awareness of homophobia and discrimination.
The Trinity winger has called for a season-long campaign of rainbow laces.
Although he welcomed the backing of Premier League teams like Manchester City, Davis told the BBC: “It would be nice if it stuck through the whole season rather than clubs just getting on it for one weekend and then leaving it out.”