Yamaha rider Rossi's 1m59.999s had him ahead in the closing stages, but Pedrosa achieved an identical lap on his Honda with eight minutes to go.
The whole lead pack was extremely close, with Andrea Dovizioso providing more encouragement for Ducati as he lapped with 0.068s of Rossi and Pedrosa in third place.
Open class rider Aleix Espargaro continued to fly on Forward's FTR-Yamaha, as he edged out LCR Honda's Stefan Bradl for fourth.
Two-time world champion Jorge Lorenzo was back in seventh place. The Spaniard has been unhappy with Bridgestone's 2014 tyre throughout testing so far, and ended Friday between Alvaro Bautista and Cal Crutchlow.
Tech 3 Yamaha duo Bradley Smith and Pol Espargaro completed the top 10.
This week's three day run at Sepang was the final full-field MotoGP test before the season-opener in Qatar on March 23.
The works Yamaha, Honda and Ducati teams will take part in a test at Phillip Island from March 3-5, which has been arranged for tyre safety reasons after the problems that marred last year's Australian GP.
The rest of the field will test at Losail on March 7-9.
Pos Rider Team/Bike Time Gap Laps
1. Valentino Rossi Yamaha 1m59.999s 41
2. Dani Pedrosa Honda 1m59.999s +0.000s 50
3. Andrea Dovizioso Ducati 2m00.067s +0.068s 42
4. Aleix Espargaro Forward FTR-Yamaha 2m00.101s +0.102s 43
5. Stefan Bradl LCR Honda 2m00.164s +0.165s 48
6. Alvaro Bautista Gresini Honda 2m00.506s +0.507s 60
7. Jorge Lorenzo Yamaha 2m00.619s +0.620s 70
8. Cal Crutchlow Ducati 2m00.790s +0.791s 62
9. Bradley Smith Tech 3 Yamaha 2m00.804s +0.805s 71
10. Pol Espargaro Tech 3 Yamaha 2m01.032s +1.033s 54
11. Andrea Iannone Pramac Ducati 2m01.198s +1.199s 47
12. Randy de Puniet Suzuki 2m01.430s +1.431s 55
13. Yonny Hernandez Pramac Ducati 2m01.497s +1.498s 56
14. Colin Edwards Forward FTR-Yamaha 2m01.748s +1.749s 35
15. Nicky Hayden Aspar Honda 2m01.924s +1.925s 59
16. Michele Pirro Ducati 2m02.029s +2.030s 48
17. Hiroshi Aoyama Aspar Honda 2m02.070s +2.071s 61
18. Scott Redding Gresini Honda 2m02.228s +2.229s 50
19. Hector Barbera Avintia FTR-Kawasaki 2m02.341s +2.342s 54
20. Katsuyuki Nakasuga Yamaha 2m03.115s +3.116s 30
21. Mike di Meglio Avintia FTR-Kawasaki 2m03.499s +3.500s 52
22. Karel Abraham Cardion Honda 2m04.304s +4.305s 29
23. Nobuatsu Aoki Suzuki 2m06.482s +6.483s 14
- Sports & Recreation
- Andrea Dovizioso
- Stefan Bradl
- Tech 3 Yamaha
- Aleix Espargaro
- Jorge Lorenzo
- Alvaro Bautista
- Dani Pedrosa