He threw his touchdown pass to Ryan Whalen on fourth-and-4 to help the Cardinal tie the game early in the fourth quarter and then won it with his 4-yard run in the final minute.
After Stanford stopped Robert Hughes on third-and-2 from the Irish 35 with less than 6 minutes left, Gerhart carried seven times for 54 yards on the winning drive, bowling over would-be tacklers before scoring his 26th rushing touchdown of the season. The fans chanted "To-by! To-by!" throughout the drive.
Clausen and Tate weren't done, driving to the 24 before Chase Thomas sacked Clausen at the 31. On the final play, Clausen's desperation heave into the end zone was batted down by Michael Thomas, giving Stanford its first win against Notre Dame since 2001.
Weis could be done too after falling to 35-27 in five seasons as Irish coach. He was set to go back to Indiana with the team instead of going on a recruiting trip as originally planned and will meet soon with athletic director Jack Swarbrick.
"We'll engage in the evaluation in earnest following this game and we'll go from there," Swarbrick said before the game, adding that no potential candidates have been contacted.
Weis, who has six years left on a 10-year contract signed midway through his first season, took a 35-26 record into the game against Stanford in five years as Irish head coach. His .565 winning percentage is worse than the .583 marks that got his two predecessors, Tyrone Willingham and Bob Davie, fired.
The game could also be the last at Notre Dame for Clausen and Tate, who must decide whether to skip their senior seasons to go into the NFL draft. The Irish have not decided whether to accept a bowl bid.
Clausen matched a career high with five touchdown passes, completing 23 of 30 for 340 yards. Tate had 10 catches for 201 yards and three scores, while Michael Floyd also caught two touchdown passes.
Weis opened up the playbook in what could have been his goodbye game. The play of the game for the Irish came early in the third quarter when they lined up in the Leprecat formation. Hughes took the direct snap out of the shotgun and handed to Tate on an end-around. Tate flipped it to Clausen, who was lined up as a receiver to start the play, and Clausen then found a wide open Floyd for a 46-yard touchdown.
Tate added his own highlight reel play early in the fourth quarter catching a short pass from Clausen at the 19 with Stanford giving him a huge cushion. Tate then wove his way through nine defenders, running all the way across the field to complete the 28-yard score that made it 38-30.
Stanford coach Jim Harbaugh had a few of his own tricks as well, calling the fourth-down halfback option. Andrew Luck's pass to Jim Dray for the 2-point conversion tied the game at 38 with 8:59 to go.
The teams traded early touchdowns after fumbles deep in their territory, with Gerhart scoring on a 4-yard run after a fumble by Theo Riddick at the 13 on Notre Dame's first play from scrimmage and Clausen connecting on a 5-yarder to Tate after Tyler Gaffney fumbled a punt at the 16.
Clausen added an 18-yard touchdown pass to Michael Floyd and a 78-yarder to Tate one play Richard Sherman's personal foul turned a third-and-15 from the 7 into a first down. Owen Marecic's 1-yard run with 11 seconds left in the half cut Notre Dame's lead to 24-20.