The loss was Alabama's first at home this season (23-1) and snapped its school record 27-game winning streak at Sewell-Thomas Stadium.
The one-run loss also snapped Alabama's 10-game winning streak, dating back to its 4-3 win over Southern Miss on April 2.
With the win, Ole Miss moved to within one game of the Crimson Tide for first-place in the overall SEC Western race.
Alabama (33-6, 12-4 SEC), ranked as high as second in the polls, left 13 base runners, including nine in scoring position, missing numerous opportunities to score runs in a close game.
"It was a great college baseball game against two outstanding teams," Alabama head coach Jim Wells said. "The story of the game was the 13 runners left on base. We had opportunities, but never got the big hit. (Lance) Cormier pitched well enough to win the game, we just left too many runners on base."
Ole Miss (31-8, 11-5 SEC), ranked as high as ninth in the polls, took its only lead of the game on Josh Christian's three-run home run in the eighth inning to give the Rebels a 4-1 lead Chad Sterbens and Drew Rogers singled ahead of Christian's fifth home run of the season.
The Crimson Tide cut the lead to 4-3 in the bottom of the eighth inning on Scott McClanahan's two-out double to left-center field. Allen Rice and Travis Garner started the rally with back-to-back singles. McClanahan's team-leading 15th double gave the Tide hope in the eighth inning.
T.J. Bean, who earned his fourth save of the season, came out of the pen and got Adam Pavkovich to pop up to second baseman Matt Tolbert, leaving another runner in scoring position.
Beam survived a ninth inning rally, too. Jeremy Brown and Beau Hearod posted back-to-back one out singles, but Beam got Rice to fly out to Burney Hutchinson in left and ended the game when Garner took a called third strike.
UM starter J.R. Pickens (7-2) earned the win, allowing just two runs and eight hits in seven innings. He added four walks, two strikeouts and hit one batter.
Cormier (8-1) suffered his first loss of the year for Alabama, despite his fourth complete game. The senior allowed four runs (3 earned) and 00 hits in his 132-pitch effort. He added four strikeouts and walked three batters.
Cormier tied the Alabama career record with 81st career appearance on Friday. Jonathan Blankenship (1998-2000) also had 81 appearances in his career for the Tide. Cormier's four strikeouts moved him into sole possession of second place on the all-time charts with 265 career strikeouts. He surpassed Al Drumheller's (1991-93) total of 262 strikeouts. The record holder is Mike Sodders (1985-88) with 274 career strikeouts.
Alabama took a 1-0 lead in the bottom of the first inning on a pair of two-out doubles by Peter Stonard and Brown. Stonard doubled down the right field line and Brown followed with a double down the left field line to give the Crimson Tide a 1-0 lead.
Brown's RBI double extended his hitting streak to a season-high 10 games, tying Brent Boyd and Beau Hearod for team honors. The double was also Brown's fifth two-base hit in his last three games.
The Crimson Tide wasted a bases-loaded, one-out opportunity in the third inning that could have potentially broken open a close game. Adam Pavkovich reached on a one-out double to left field and then Stonard and Brown drew back-to-back walks to load the bases.
Pickens got out of the jam as Beau Hearod popped up to shortstop Chad Sterbens and Allen Rice struck out, leaving the bases loaded.
The Rebels tied the game with an unearned run in the fifth inning off Cormier, but also stranded the bases loaded. Drew Rogers led off with a single and took second on Cormier's throwing error on a pickoff attempt at first base. Josh Christian's ground to Pavkovich at shortstop moved Rogers to third base.
Tolbert followed with a base hit through the left side of the infield to score Rogers from third and tie the game at 1-1. Charlie Waite reached on a error by Allen Rice and after Clint Farrar flied out to Scott McClanahan in center field, Burney Hutchinson walked to load the bases. Seth Smith ground out to Pavkovich at short to end the inning and leave the bases loaded.
Alabama left at least one base runner in every inning, missing out on the timely hit in a one-run game. After leaving the bases loaded in the third inning, Alabama also left two men on base in sixth, seventh and ninth innings. Of the 13 runners stranded, nine were left in scoring position, with three runners left at third base.
Ole Miss stranded nine base runners, but got the key hit on Christain's three-run home run.
The Rebels had 11 hits in the game against Alabama, but none from Hutchinson, the current SEC Player of the Week. With an 0-for3 game, Hutchinson's season-high 12-game hitting streak was snapped.
The series continues with a 2 p.m. game Saturday and Sunday. The Crimson Tide will send left-hander Jeffrey Norris (Soph., 3-0, 2.22 ERA) to the mound against Ole Miss right-hander Pete Montrenes (Sr., 6-2, 0.00 ERA).