It was a cagey opening 15 minutes between the two sides, with the hosts edging possession but unable to create any clear-cut opportunities.
Liverpool were visibly moving the ball quicker than in recent weeks and they were rewarded with an opener as they ended their recent goal drought.
Despite the Reds looking likely to add to their opener, United found an equaliser through Mason Greenwood, who latched on to Marcus Rashford's long ball and slotted the ball past Alisson to level the scores.
Liverpool found themselves behind at the start of the second half after Rhys Williams failed to make contact with an attempted clearance, with Marcus Rashford running through on goal to make it 2-1 with a tidy finish past Alisson.
But the Reds equalised just before the hour mark in impressive fashion. James Milner and Firmino linked up well before the latter found Salah, who netted first-time to make it 2-2.
Liverpool looked likely to score a third but it was the hosts that clinched the decisive goal in the end. Substitute Bruno Fernandes slotted the ball home with an accurate free-kick, beating Alisson on his own side, to give United a 3-2 victory.