Murray served the opening game on Centre Court and his team raced into a 40-love lead.
However, Martin and partner Raquel Atawo won the next two points to pile pressure on the former world No 1.
But Williams quickly eased any nerves with a thumping volley at the net which struck the body of Martin.
The winner allowed Murray to hold his first service game but Martin cowered as the ball was fizzed in his direction.
Eight-time Wimbledon winner Williams raised her hand and apologised a number of times as the teams headed back to the chairs for the change of ends.
There was no malice in the incident, unlike when Nick Kyrgios smashed a forehand at Rafael Nadal earlier in the week.
The Australian was taking on his rival on Centre Court in round two and deliberately aimed for the world No 2’s chest.
It led to Nadal sending a death stare at his opponent during their fiery grudge match.
Earlier in the day, Williams booked her place in the semi-finals of the single’s draw with a three-set win over Alison Riske.
“I just needed to just fight,” Williams said.
“Alison, I mean, she played great throughout the whole tournament.
“She’s beaten so many amazing players, players that have had great years.
“She was not giving it to me. I needed to step up and take it. That’s what I had to do.”