The Black Cats faced a mountain to climb after going two goals down within 20 minutes following strikes from Robin van Persie and Tom Cleverley.
Wayne Rooney added a third goal on 59 minutes but substitute Fraizer Campbell headed a consolation as the visitors pressed towards the end.
O'Neill told Sky Sports: "The goals that we conceded we could have avoided and I thought we gifted them those particular goals.
"Manchester United, the last thing you want to do is give them some goals to go and get their confidence up throughout the game.
"In the second half, I thought despite going three-nil behind, we never gave up.
"We kept going, we got our rewards, we got back into the match and we had a number of chances in the second half maybe to have reduced the arrears.
"That said, so had Manchester United, they're a fine side.
"But we can take a lot of heart, a lot of encouragement from the performance, particularly the second half."