The Senegal forward pulled the home side level from a George Honeyman cross late in the first half, but neat finishes from on-loan Athletic Bilbao forward Kike Sola and big-money January signing Jordan Rhodes saw the Teessiders come away with the win.
New man Eboue impresses for Sunderland
Emmanuel Eboue took a minor knock early in the game but Sam Allardyce's newest signing shook it off to get 75 minutes of action under his belt.
The Ivory Coast defender caused problems down the right wing throughout his time on the pitch and almost grabbed a goal of his own, but he sent his shot wide from a difficult angle.
N'Doye and Jeremain Lens had the best chances to get a second goal for Sunderland, but wayward finishing meant that frequently impressive build-up play went largely unrewarded.
For the visitors, the biggest boost came with the return of key centre-half Daniel Ayala, who played the second 45 minutes. The Spaniard has been out of action for some weeks with a mystery injury, and Boro's form has suffered significantly in his absence.
Wearsiders fail in quest for local friendly double
Thursday's game was not the first 'secret' friendly Sunderland have taken part in this season, with another having been played against rivals Newcastle United at the end of January.
That match concluded with a considerably more favourable scoreline for the Black Cats, as midfielder Duncan Watmore bagged a hat-trick in a headline-making 6-0 semi-derby victory.
However, in both instances Allardyce will have been more concerned with maintaining fitness and performance levels, particularly among his non-starting players, during the last international break of the season.
Once the current campaign has ended, Sunderland will play host to an international fixture as England gear up for the European Championships with a friendly against Australia.