The world number two cruised through the opening set but saw his level drop in the second as Sousa picked up his game to level affairs.
The Scot clearly took umbrage at dropping a set and raced through the next two to secure a 6-2 3-6 6-2 6-2 triumph at Melbourne Park.
The Scot, who was unaware that his father-in-law, Nigel Sears, who coaches Ana Ivanocic, had collapsed while watching his charge's match with Madison Keys, will now face either big-serving Aussie Bernard Tomic or his compatriot John Millman for a place in the quarter-finals.
Murray did not look at his very best on Saturday but had never lost to Sousa in six previous matches and it was a surprise when he dropped the second set, but the 28-year-old is not second in the world rankings for nothing, and he proved his class by dismantling his opponent to claim the match.
The news on his wife's father is encouraging as Murray's brother, Jamie, told reporters that he is "undergoing tests" but was "conscious, talking and sitting up".
The two-time Grand Slam winner left immediately to visit Sears in hospital but said in a statement released through tournament organisers: "It was tricky. I didn't feel I was in a great rhythm and wasn't hitting the ball cleanly at the start. He was hitting the ball great, close to the lines, and making me do a lot of running.
"Once I started to hit the ball a little bit cleaner towards the end of the match I was able to get him in his backhand corner and dictate more of the points."