Martinez, who is recovering from an ankle injury, and professional partner Karina Smirnoff scored 24 out of a possible 30 points for their cha cha, with Carrie Ann Inaba suggesting the musicality was off and he had been ahead of the music.
However, the pair went on to score a perfect 30 for their salsa-inspired freestyle, in honour of Martinez's Latin roots, which featured a complex lift.
Inaba said they displayed the "sickest lifts [she had] ever seen", while fellow judge Len Goodman called it "fantastic" and Bruno Tonioli said Martinez was "wild and exuberant with animal physicality".
Speaking to Access Hollywood backstage, Martinez said: "I wanted to use the scores I'd gotten for the first dance as motivation to go out there on the second dance and really redeem myself and show them that's not the way JR gets down! He deserves to have better scores!
"I expect more out of myself and [Karina] knows I can do a lot better."
As for the complex lift, which involved Martinez hooking his partner's neck, he said: "It's a dangerous lift... but it shows she trusts me. When she panicked earlier I said, 'Listen, I got you, don't worry about it'.
"We are here to entertain people but I've said to her all season, if something was to go wrong, I will hold on to you. I don't care if it's the most awkward looking thing to people at home, as long as you're safe that's all that matters to me."
Taking to his Twitter account after the show, Martinez wrote: "Some steps won't always be in sync but you must be willing to keep stepping in order to get on the same beat! #failure is #NOT an #option."
Smirnoff, meanwhile, wrote: "OMG! What a night! Wow! Hopefully u loved our freestyle! Please vote! We r so close! @knowjr love u!"
Martinez and Smirnoff finished the evening in second place on the leaderboard alongside Ricki Lake and three-time champion Derek Hough with 54 out of a possible 60 points.
Rob Kardashian and past winner Cheryl Burke are in front with 57 out of a possible 60 points, which included their first perfect score of the season.
Dancing with the Stars concludes tonight (November 22) at 8/7c on ABC
> Dancing with the Stars poll - who do you want to win?
> Dancing with the Stars finale part 1 - live blog