The 21-year-old came off the bench to complete a remarkable comeback for Stuart McCall's side from 2-0 behind.
Eoin Doyle's double gave Hibs control but Jamie Murphy tapped in from close range to cut the hosts' lead before glancing home a leveller with 10 minutes remaining.
Things got worse for Pat Fenlon's side when McHugh converted Henrik Ojamaa's cross two minutes from the end and James McPake was dismissed for a second yellow card during injury time.
McHugh passed up a glorious opportunity to fire Motherwell ahead two minutes after Murphy's leveller and admitted that his late goal helped him avoid the wrath of his team-mates.
"The last two years have been pretty frustrating for me personally, the strikers here have been doing well and I have always said that when I get my chance I will have to take it," McHugh said.
"I am delighted to have got the goal after coming off the bench - hopefully I can push on from here.
"I would have taken a bit of stick from the lads if I didn't score the winner, I'm not really sure what happened - Chris Humphrey fired a great ball across and I've not been able to turn it in from about a yard out."
Motherwell looked to be heading for their first defeat in six league matches after falling 2-0 behind 10 minutes into the second half.
McHugh felt that the Fir Park side demonstrated their fighting qualities to find a way back into the match and admitted their first-half display was below par.
"It was a great result and the lads showed great spirit to fight back in the second half," McHugh said.
"At half-time everyone knew that the performance was nowhere near what we are capable of, we did that in the second half though and we were delighted to take all three points."
Fenlon was frustrated at his side's approach after going 2-0 ahead.
The former Bohemians manager was adamant that removing his two strikers did not prove to be costly - instead blaming their failure to retain possession.
"We tried to see the game out instead of trying to kick on and score the third one to actually finish the match off," Fenlon said.
"We played really well in the first half, but in the second half we just stopped playing.
"The second goal seemed to give them a spur and knocked us back on our heels.
"It was important that we retained the ball better than we did after we scored the second goal - we didn't do that and we got punished for it."