Lewis, a three-time winner this year, shot a 68.
"It was a little frustrating. I played really good, though, so I can't be upset," Lewis said. "A lot of those putts I hit exactly where I wanted to and they just didn't go in. A bogey-free tournament I've never done before, so I keep checking things off the list."
Lizette Salas was third at 17 under after a 69, and 2008 champion Cristie Kerr was another stroke back after a 69.
A 72-hole event for the time, the tournament returned to Columbia Edgewater after four years at Pumpkin Ridge.
For Pettersen, the Safeway victory capped an emotional three-week period. It started with Solheim Cup, where Pettersen helped Europe rout the United States.
"Seems like Portland is a good stop for me," Pettersen said. "Seems like I always play well here. This was a good finish to a solid three-week stretch for me."
A key point during Pettersen's final round was her response after hitting a poor 8-iron at the par-3 second hole that led to a double bogey.
She quickly recovered with a birdie on the par-4 third that started a stretch where she birdied five of the next six holes and eight of 11.
Pettersen made an 18-foot birdie putt at the par-3 eighth to overtake Lewis for the lead, curled in a 5-footer for birdie on the par-5 10th and made a 25-footer from off the green on the par-4 11th.