The Red Sox had the most potent offence in the majors in the regular season but through the 1-0 defeat in game one and five innings from Max Scherzer in game two they were runless on one hit.
By the midway point of the sixth the Tigers led 5-0, thanks largely to home runs from Miguel Cabrera and Alex Avila off Red Sox starter Clay Buchholz.
Shane Victorino broke up Scherzer's no-hit bid in the bottom of the sixth and Dustin Pedroia scored him to narrow the deficit to four, but the big drama came in the eighth.
Will Middlebrooks began the rally with a one-out double, Jacoby Ellsbury walked and, after Shane Victorino struck out, Pedroia singled to right.
The Tigers turned to closer Joaquin Benoit, but Ortiz swung at the first pitch and sent the ball into the Boston bullpen, despite a valiant effort from Torii Hunter.
And the comeback was complete in the ninth when catcher Jarrod Saltalamacchia delivered a walk-off hit to score Jonny Gomes.
Scherzer pitched seven innings of one-run ball in all, scattering two hits while striking out 13 and walking two, while Boston closer Koji Uehara pitched a scoreless ninth for the win.
The victory tied up the seven-game series at 1-1 before the teams head to Detroit for game three on Tuesday.