Eduardo Nunez drove in the go-ahead run with an eighth-inning sacrifice fly and the New York Yankees overcame a four-run deficit to beat Toronto Blue Jays 9-6 on Sunday to remain tied with Baltimore atop the AL East.
Alvarez closed out his second major league season, and his first full campaign, by allowing two runs and seven hits in six efficient innings, avoiding his third straight defeat.
The 22-year-old Venezuelan, who walked none and struck out four, finished 9-14 with a 4.85 ERA.
"He goes into the offseason, I would think, with a lot of confidence about the way he's pitched late in the season," Blue Jays manager John Farrell said.
Speaking through a translator, Alvarez called 2012 "a great year of experience" but acknowledged he needs to add a slider to his arsenal to find success as a starter.
"I don't know if I'm going to be able to play winter ball or not but if I am I'm going to work on (the slider)," he said. "If I have three pitches and can continue to keep the ball down like I did at the end of the season, it's going to be better."
New York was down 5-1 going into the sixth.
"Tonight was a season-defining game for us," New York's Nick Swisher said.
Eric Chavez homered for the Yankees (92-67), who completed a 4-3 trip and headed home for a season-closing series against Boston. The Orioles (92-67) beat the Red Sox 6-3 and traveled to Florida for their final series, at Tampa Bay.
"Every game feels like it's a playoff game right now," Yankees catcher Russell Martin said. "That's our attitude."
New York has overcome four-run deficits to win twice in a nine-game span for the second time this season, according to STATS LLC.
With both the division title and the AL's best record still up for grabs, the Yankees aren't relishing the prospect of playing the last-place Red Sox, who have lost 90 games for the first time since 1966.
"They would like nothing better than to spoil our season," Martin said. "Us knowing that, I don't think anybody is going to take them lightly."
A wild-card berth and the one-game playoff that comes with it isn't to New York's liking. The Yankees opened a 10-game AL East lead in mid-July and have never failed to finish first in a season in which they led by at least 6 games.