Sunderland are on the brink of relegation from the Premier League after fellow strugglers Middlesbrough beat them in the Tees-Wear derby.