The Yamaha rider rode a brilliant race from pole position, holding off rookie Marquez for 22 laps at the Motegi Twin Ring track and frustrating his fellow Spaniard's championship ambitions for the second week in a row.
Honda rider Marquez still leads the championship by 13 points, however, and a fourth place finish in Spain on November 10 would guarantee he becomes the youngest champion in the 64 years of the premier class of Grand Prix racing.
The 20-year-old's team mate Dani Pedrosa finished third, ending his slim hopes of winning the title, while Honda's Alvaro Bautista ensured a Spanish sweep of the top four places.
"This track is normally better for them so winning here in Honda's home race... is a pleasure," Lorenzo told reporters.
"It's been a really hard, physical race but I really kept my concentration and I really wanted this victory."
A first attempt to seal the title at Phillip Island in Australia last week ended with disqualification for Marquez after a mistake by his team and victory for Lorenzo.
Marquez's incident-packed debut season continued even on Sunday morning when he slid off his bike and careered across the trackside gravel in the final practice session.
ROSSI MISTAKE
After fog and rain combined to wipe out the first day and a half of the weekend, though, the Honda-owned track was bone dry at the start of the penultimate race of the season.
Lorenzo lined up with Marquez beside him but by the first corner two Yamahas led the race with Valentino Rossi's excellent start putting him in second place.
Any hopes that Rossi might obstruct the inevitable Honda charge were dashed on the second lap, though, when the seven-times world champion misjudged his braking and Marquez and Pedrosa swept past.
They quickly closed the one-second gap to Lorenzo but the 26-year-old showed exactly why he has won two world titles with a near faultless ride to claim his seventh win of the season and the 30th of his MotoGP career.
"It was a difficult race for me because of this morning's big crash but also because it was my first time in this track," Marquez admitted.
"I tried to follow Jorge. In the middle of the race it looked like we were stronger but in the end I saw that Jorge tried to push a little bit more.
"I felt I was too much on the limit and I said 'okay, 20 points for the championship'. Valencia will be another race and very interesting for sure."
Marquez's 17-year-old brother Alex earlier won the Moto3 race for his first Grand Prix victory in an action-packed encounter that also kept that title race alive, while Pol Espargaro's victory in the Moto2 race sealed the championship for the Spaniard.
Image: Jorge Lorenzo
Photograph: Mirco Lazzari gp/Getty Images
BEST Sports Photos of the Week!
Lorenzo wins San Marino Grand Prix
BEST Sports Photos of the Week!
Biking: How to corner like Valentino Rossi