Marquez and championship rival Andrea Dovizioso shadowed Pramac Ducati rider Petrucci for much of the wet-weather race, with their battle turning into the fight for the victory when Jorge Lorenzo crashed out of first place.
As track conditions improved in the closing stages, Dovizioso dropped away from the leading pair, but Marquez managed to stick with Petrucci and dived down the inside of the Italian at Turn 1 on the final lap.
"I was trying to [stay in] control all of the race, trying to control myself because I was able to be little bit faster - but I said 'okay, you must be patient'," Marquez said afterwards.
Grand Prix Valencia
'An inspiration for me' - Federer leads Rossi tributes after final race
"Then when I saw that we started to open a gap to Dovi, [for] one moment I thought about staying in second position - but then on the last lap I said 'I'll try'."
Marquez often chose to settle for points rather than go all-out for victory during his 2016 title run, but the Spaniard felt he could not do so at Misano after his costly mechanical failure at the British GP.
"This championship is really tight, five points can be a lot in the end," he said.
"[With] these five points, at the end of the championship in Valencia you never know [if] you will miss or not.
"So I tried, I pushed - [it] was a big risk, of course. "If I crash, everybody will write 'he never changes, bla-bla-bla', but it's my style.
"This style give me five championships and I will keep pushing, but always try to manage the risk, of course."
While Marquez battled Petrucci up ahead, Dovizioso slowed his pace considerably in the latter stages of the race and finished almost 12 seconds behind his title rival, but that was still enough for him to secure a comfortable third place.
He will now head to the next round at Motorland Aragon level on points with Marquez.
"For sure everybody wants to try to win every time," Dovizioso said.
"I was there but I wasn't feeling so good on the bike.
"The risk was too high, everybody almost crashed today.
"I think today it was a day [when] we don't have to make a mistake.
"I am happy about the podium; I've never [been on] the podium in Misano so we have to be happy about that.
"It was a very difficult weekend but we are there - we did another podium in a strange and difficult moment."
"Today when I was riding, I thought, 'okay, this is a day where it is more important to take [some] points than zero."
Rossi announces decision to retire at end of season
MotoGP star Jason Dupasquier dies after crash