The Swiss 17-time Grand Slam champion came into the match against compatriot Stanislas Wawrinka with an enviable 11-1 head-to-head record but struggled to impose himself and was forced to dig deep before winning 4-6, 7-6 (7/4), 6-0.
Earlier, Serbian second seed Djokovic looking to wrestle the World no 1 ranking from Federer barely broke sweat against Spain’s Feliciano Lopez, wrapping up a straightforward 6-3, 6-3 victory in front of enthusiastic fans.
In-form Djokovic, fresh from his third China Open title in Beijing on Sunday, struck 12 aces and took advantage of some below-par serving by the left-handed Lopez, breaking him three times.
US Open champion Murray, 25, proved far too strong for Ukraine's Alexandr Dolgopolov, serving consistently well and seizing on five out of six break points to win 6-2, 6-2 in just 57 minutes.
It was the first match of the tournament for the Scot, who had a walkover into the third round. The top eight seeds received a first round bye.
Spotted: Sridevi's daughter Jhanvi Kapoor in Bandra
Photos: Kajol, Sridevi, Raveena Tandon at Mumbai airport
Photos: Akshay Kumar, Anushka Sharma, Ranveer Singh at Umang 2017
Photos: Sunny Leone, Shah Rukh Khan on Salman Khan's 'Bigg Boss 10'
Birth anniversary special: Remembering Subhas Chandra Bose