Former world number one Murray enjoyed a first win over a top-15 player since his return from hip surgery after a year out.
Goffin is ranked 11 in the world, and was defending the tournament he won a year ago.
It is a win that will give Murray - who is ranked at 311 - enormous heart as he prepares for a quarter-final meeting with sixth seed Fernando Verdasco, who ousted him from the US Open second round in June.
'I want to be winning matches' - Murray hoping for strong finish to 2021
"I felt like in terms of the way I hit the ball, it was the best I've played, and I think I knew that I was going to have to hit the ball very well if I wanted to win," Murray said.
Fellow Brit Cameron Norrie had already reached the last eight with a 6-4 7-6 (10-8) win over world number 18 Borna Coric.
World number 73 Norrie enjoyed 14 aces and saved nine out of 11 break points as he claimed the match 10-8 in the second set on the seventh match point.
He could potentially meet Murray in the semi-final.
British number two Norrie's reward is a meeting with Yoshihito Nishioka after the Japanese sixth seed completed a shock 7-6 (7-5) 3-6 7-5 victory over Denis Shapovalov.
Murray will not be 'wading in' with advice for Raducanu
'The younger generation has taken over' - Becker hails 'Dame Emma Raducanu'