Seth Baxter (Joris Jarsky), a convicted murderer who was released early from prison on a technicality, is chained to a table beneath a pendulum blade. A videotaped message informs him that in order to survive, he must crush his hands by putting them into two presses and pushing the buttons inside. Even though he does so, the pendulum swings down and slices him in half. The fact that the trap was inescapable marks it as a creation of someone other than Jigsaw (Tobin Bell).
In a scene from the end of Saw IV, Agent Peter Strahm (Scott Patterson) enters the room where Jigsaw died and shoots Jeff Reinhart (Angus Macfadyen) dead in self-defense. He then looks around and discovers the bodies of Jigsaw and Amanda Young. It is at this time that he hears the door slam shut, and he is locked in by Lieutenant Mark Hoffman (Costas Mandylor). Strahm soon finds a hidden door that leads into a passage. Here a microcassette recording urges him not to proceed any further; ignoring it, he moves down the passage and is attacked by a figure in a pig mask.
When Strahm wakes up, he discovers that his head has been sealed in a box, which quickly begins to fill with water. A self-administered tracheotomy using a pen keeps him breathing until the police arrive at the Gideon meatpacking plant. Hoffman emerges, carrying Jeff's daughter Corbett (Niamh Wilson), and claims that he saved her and that no one else inside survived. He then sees Strahm being brought out alive as well. Shortly afterward, the chief of police announces an end to the Jigsaw murders and congratulates Hoffman for closing the cases.
Jill Tuck (Betsy Russell), John Kramer's ex-wife, receives a videotape and a box from his lawyer. On the tape, John tells her that the items in the box are of "grave importance" and that she will know what to do with them. After looking inside, she takes the box and hurries away without revealing its contents.
Luba in the first test
Strahm learns that Agent Lindsey Perez (Athena Karkanis) died of the wounds she suffered in Saw IV, and that the last thing she said was Hoffman's name. He confronts Hoffman with this fact, further unsettling him. Gathering up all the files on Jigsaw’s victims, Strahm revisits some of the crime scenes and pieces together Hoffman's involvement. Seth had murdered Hoffman's sister, so Hoffman set up the inescapable pendulum trap in revenge. Flashbacks reveal that Jigsaw used his knowledge of these events to blackmail Hoffman into becoming his accomplice. The two worked together to capture Paul Stallberg (Mike Butters) for the razor wire trap in Saw, set up the nerve gas house in Saw II, and discussed plans before Amanda Young (Shawnee Smith) brought Lynn Denlon (Bahar Soomekh) to Jigsaw's bedside in Saw III.
Meanwhile, in a sewer, five people, Ashley, Charles, Brit, Mallick, and Luba, wake up in a trap in which collars are locked around their necks, strung on a cable connected to a set of guillotine blades mounted on the wall behind them. The keys to the collars are in glass boxes on pedestals at the other end of the room. When Mallick (Greg Bryk) rushes to get his key and Charles (Carlo Rota) attempts to stop him, a one-minute countdown starts as everyone else is dragged toward the blades. All but Ashley (Laura Gordon) are able to get their keys and free themselves in time; she is decapitated when the collars are automatically pulled back to the wall and into the blades.
In the next room, the four survivors must break jars hanging from the ceiling and find three keys to shelters that can protect them when the bombs in the room explode. Charles attacks Mallick and takes a key from him, but Luba (Meagan Good) knocks Charles down in turn and gives the key back to Mallick. Luba, Brit (Julie Benz), and Mallick unlock and enter the shelters, leaving Charles to die in the explosion.
The third room requires five electrical cables to be connected to a bathtub full of water in order to unlock the door (set to a countdown timer), but they are all too short to reach it. Luba knocks Mallick into the tub, intending to use him to complete the circuits, whereupon Brit fatally stabs her in the neck. By throwing her body in the tub and hooking all the cables to it, Brit and Mallick get the door open.
In the fourth and final room, the exit door can only be opened by filling a beaker with ten pints of blood, to be obtained by the captives putting their arms into a box fitted with circular saws. Here, noticing five holes in the box for their arms, Brit realizes that the five of them were meant to work together so that they could all survive to this point. With no other options, she and Mallick begin sawing their arms to fill the beaker themselves.
While these games are playing out, Hoffman steals Strahm’s cell phone and uses it to make Strahm’s boss, Dan Erickson (Mark Rolston), think that Strahm is Jigsaw's accomplice. He plants the phone and Erickson's own personnel file outside the exit from the fourth room, and Erickson arrives here just as Brit and Mallick get the door open. Both pass out from blood loss as Erickson calls for backup; he then puts out an all-points bulletin for Strahm's arrest.
Strahm’s investigation brings him to a small underground room that contains a transparent box full of broken glass. A recorder inside the box delivers a message from Hoffman: Strahm will have to trust him and get in the box if he wants to survive. Instead, Strahm stops the tape short, hides in a corner, and ambushes Hoffman when he enters the room, eventually throwing him into the box and closing it. Strahm then plays the remainder of the tape, learning that if he did not comply, he would die and "simply vanish," with Hoffman's legacy becoming his own in the process. The door to the room closes and locks as the box lowers Hoffman safely beneath the floor, while the walls start to slowly close in, crushing Strahm to death.