Luiz opened the scoring for Brazil in the 18th minute, after a corner from Neymar that was flicked on by Thiago Silva. Luiz was at the back post to scramble the ball in.
Chile, who were outstanding throughout, equalised after 32 minutes when Alexis Sanchez punished poor Brazil defending with a cool finish past Julio Cesar.
Both teams pushed for a winner, but neither team could find one as the result was forced to penalties where hosts Brazil come out on top 3-2.
Here are the player ratings for Brazil:
Julio Cesar - 8
Couldn't do anything for Chile's goal. Made a great save when the score was 1-1 in normal time from Aranguiz, saved two penalties in the shoot-out.
Dani Alves - 7
His defensive performance was soild, far better than that of his club. Going forward could improve, but had a good long-range shot saved in the first half.
Thiago Silva - 7
Set up the goal for Luiz with a flick on, looked assured throughout the match and played a true captains role. Could have done better closing down Sanchez's goal.
David Luiz - 8
Scored the first goal, his array of passing throughout the match was outstanding. Often the catalyst of everything Brazil did well. Scored his penalty in the shoot-out.
Marcelo - 7
Looked to get forward from left-back a lot, but like Alves on the right, looked to play a more defensive role in the Brazilian side. Did his job well.
Luiz Gustavo - 7
Really good energy in the centre of midfield from Gustavo, was booked though so will miss their quarter-final match. Will be a big loss for Brazil.
Fernandinho - 7
Started instead of Paulinho after his goal against Cameroon. Good energy and closing down as always from the Man City man, subbed off after 72 minutes with a slight injury.
Hulk - 8
Real powerful performance from Hulk. Thought he scored the winner in the second half but for Howard Webb to adjudge he handled the ball. Had two good efforts in extra-time saved, very good performance.
Oscar - 7
The Chelsea midfielder's passing was outstanding, and often went wide to find space in the Chile defence. Didn't see as much of the ball as he would have liked going forward though, defensively played well.
Neymar - 8
He may continue to be seen as the man to carry Brazil's hopes, but it looks like he is coping with the pressure fine. Took his penalty well and could have scored in the first half but for great defending.
Fred - 6
Continues to struggle holding up the ball and linking up play with his attacking midfielders. Was substituted off after an hour, may be dropped for their quarter final match.
Jo - 7
Come on for Fred after 64 minutes. Failed to make a real impact, missed a great chance to stamp his name on the number nine shirt.
Ramires - 7
Come on for Fernandinho after 72 minutes, the Chelsea midfielder provided a lot of energy and enthusiasm in a tiring team. Lacked real creativity and decisive play though.
Willian - 6
Come on for Oscar after 105 minutes, didn't make much of an impact on the pitch but his penalty in the shoot-out was poor, going wide of the left-hand post.