Lilly, who went 6 2/3 innings allowing five earned runs on seven hits, paid heavily for two balls left over the plate and a balk that gave the Giants a second chance.
San Francisco hit two homers off Lilly, the first coming in the third inning when Jose Cruz Jr. took Lilly's first pitch over the left-field wall to put San Francisco up, 1-0.
In the fourth, after a leadoff single by Marquis Grissom, Lilly ran into trouble of a different kind, being called for his second balk of the year.
The call was especially costly, as it came after Lilly had seemingly retired Barry Bonds on a fly ball to center field. However, as Eric Byrnes caught the fly, first-base umpire Doug Eddings signaled the balk, called Bonds back from the dugout and gave the Giants another chance.
Lilly then walked Bonds and retired the next two batters before Pedro Feliz, who homered last Sunday against Lilly, drove in Grissom and Bonds with a two-run single to center, making it 3-0, San Francisco.
"I caught the umpire by surprise by picking up my leg when I had been slide-stepping," Lilly explained.
"I didn't agree with the call. But I don't think that's why we lost the game."
The Giants added a run in the sixth on a Bonds home run to right that cleared the wall and landed in McCovey Cove for a 4-0 Giants lead.
In the seventh, after Lilly loaded the bases with two out, Macha replaced him with right-hander Mike Neu, who walked Benito Santiago for the Giants' fifth run.
"I felt good out there tonight but just didn't make quality pitches," Lilly said. "I wasn't working behind in the count a lot and wasn't making quality strikes."
For Lilly, the loss snapped a two-game winning streak but continued a season in which he's had a hard time picking up momentum.
"They're aggressive, and they swing the bat with a lot of confidence," he said,"eventually I'm going to get on track. I'm getting tired of going out there and trying to fight through a game."