Raza had looked set to drive his side to victory, helping them recover from 161-5 after 30 overs via a 128-run partnership with Tony Munyonga (43 not out).
It was the second rebuild of the innings after Asitha Fernando, who took 3-50, had dismissed Brian Bennett and Brendan Taylor before Zimbabwe had scored a run, with Ben Curran (70) and captain Sean Williams (57) putting on 118 for the third wicket.
Sri Lanka’s innings also featured two century partnerships, with Pathum Nissanka (76) and Kusal Mendis (38) scoring exactly 100 in a third-wicket pairing.
The visitors then slipped to 161-5 as Sadeera Samarawickrama and Charith Asalanka were dismissed by successive deliveries, but Janith Liyanage (70 not out) and Kamindu Mendis (57) hammered 137 from the last 14 overs.
Mendis was bowled by Ngarava’s final ball of the innings, but Madushanka’s heroics ensured Sri Lanka’s score of 298-6 was slightly too much for Zimbabwe to chase.
The visitors go 1-0 up in the two-match series, with a T20 series of three games to follow.