Martinez drove a 2-2 pitch deep into the pavilion seats in right-center to make an unlikely winner of Nathan (2-0). One night earlier, Martinez tied the score with a two-out single in the ninth before the Dodgers pulled out a 3-2 victory in 10.
Joba Chamberlain gave up a single to Hanley Ramirez to open the 10th. But left-hander Ian Krol struck out Adrian Gonzalez and Andre Ethier, and Al Albuquerque retired Matt Kemp on a grounder to get his first major league save.
Nathan, who said earlier in the day that he was experiencing a "dead arm," was trying to protect a 6-3 lead for Anabel Sanchez. But Gonzalez led off with a home run to center field, and the Dodgers loaded the bases with walks to Ethier and Kemp and a single by Juan Uribe.
Yasiel Puig, who wasn't in the starting lineup for the third straight game because of a strained ligament in his left thumb, batted for Tim Federowicz and struck out. Pinch-hitter Scott Van Slyke got a run home with a fielder's choice grounder before Dee Gordon singled to right field, delivering Kemp with the tying run.
Detroit's Nick Castellanos helped spoil Josh Beckett's long-awaited return to a major league mound with a three-run homer, his first in the big leagues.
Sanchez allowed three runs — one earned — and six hits over five innings and struck out six. Sanchez was a minor league prospect with the Boston Red Sox before he was traded to the Marlins for Beckett.
Beckett threw 85 pitches through four innings, giving up five runs — four earned — and five hits while striking out five. The three-time All-Star, who joined the Dodgers in a nine-player megadeal with Boston in August 2012, made only 15 starts with them prior to this one because of numerous injuries that had sidelined him since his previous outing on May 13 of last season.
Beckett gave the Dodgers a 3-2 lead in the second, laying down a suicide-squeeze bunt in front of the plate with 235-pound Uribe charging down the line. It was Beckett's first RBI since June 14, 2009, when he homered against J.A. Happ in an interleague game at Philadelphia.
But the Tigers pulled ahead 5-3 in the third when Castellanos drove a pitch to center field, and the ball skimmed off the top of the eight-foot fence before landing on the other side.
Detroit right fielder Torii Hunter did not play because of a bruised left knee.
NOTES: One of A.J. Ellis' biggest regrets about going on the disabled list Tuesday was missing this series against the Tigers and new manager Brad Ausmus, his teammate during Ausmus' final two major league seasons (2009-10). "I was fortunate to catch in the major leagues before I met Brad, but I wasn't a major league catcher until after I met Brad," Ellis said a day after undergoing arthroscopic knee surgery. "The two-year mentorship he gave me was what turned me into the catcher I am today. He taught me how to prepare a game plan, how to take care of my body in between starts, how to be a better teammate, and how my focus should be on my pitching staff only."